Derived Classes is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Derived Classes
| Also Known As | Number of Children (NOC) |
| API ID | CountClassDerived |
| Targets | Classes |
| Languages | Basic C# C++ Java Pascal Python Web |
| Categories | Inheritance Object Oriented |
| Cost | Query |
| Suites | Chidamber & Kemerer |
Number of immediate subclasses.
(i.e. the number of classes one level down the inheritance tree from this class).
For example:
class Vehicle {
public:
Vehicle() {}
};
class Wheeled : public Vehicle {
...
};
class Car : public Wheeled {
...
};
class Boat : public Vehicle {
...
};
class DualPurpose {
...
};
class BoatCar: private Car, public Boat, protected DualPurpose {
...
};
class TourBoatCar : public BoatCar {};
class WildLifeTourBoatCar: public TourBoatCar {};
Only TourBoatCar derives directly from BoatCar, so CountClassDerived = 1 for BoatCar. WildLifeTourBoatCar derives from TourBoatCar, not directly from BoatCar, so it doesn't count here even though it's a "grandchild" further down the same tree.
See Base Classes for the reverse relationship.
Also known as Chidamber & Kemerer - Number of Children (NOC).
- Basic: Class, Struct
- C#: Class, Struct
- C++: Class, Struct, Union
- Java: Class, Interface
- Pascal: Class, Interface
- Python: Class
- Web: PHP Class, PHP Interface