Class Metrics
The following metrics are generated for classes, templates, interfaces, structs and unions in the project source code.
Chidamber and Kemerer Object Oriented Metrics
CK Class Cohesion | Lack of Cohesion of Methods is a measure of the cohesion of the member functions of the class (Chidamber and Kemerer LCOM, 1994 revised definition). |
| Users may also select alternative definitions of class cohesion. One alternative is Hitz and Montazeri's 1996 redefinition of Li and Henry's graph theoretical calculation. The second is Henderson-Sellers definition, a ratio of methods (member functions) which do not read or set a specific attribute (member variable), averaged over all the attributes of the class. |
CK Class Coupling | Measure of the coupling, or dependency, of the class (Chidamber and Kemerer CBO). This represents the number of external classes used. |
CK Depth of Inheritance | Depth of the hierarchy of base classes of the class (Chidamber and Kemerer DIT). |
CK Number of Children | Number of classes directly derived from class (Chidamber and Kemerer NOC). |
CK Response for Class | Number of methods called by the class's methods, a measure of the class's response (Chidamber and Kemerer RFC). |
CK Weighted Methods | Total cyclomatic complexity for the class's methods (Chidamber and Kemerer WMC). |
McCabe Complexity Metrics
McCabe Average Complexity | Average cyclomatic complexity for all methods in class |
McCabe Maximum Complexity | Maximum cyclomatic complexity of any method in class. |
McCabe Total Complexity | Total cyclomatic complexity for all methods in class (same as CK Response for Class). |
Halstead Complexity Metrics
Halstead Intelligent Content | Language-independent measure of the amount of content (complexity) of the class (Halstead I). |
Halstead Mental Effort | Measure of the number of elemental mental discriminations necessary to create, or understand, the class (Halstead E). |
Halstead Program Volume | Measure of the information content of the class (Halstead V). |
Halstead Program Difficulty | Measure of how compactly the class implements its algorithms (Halstead D). This is the inverse of the Halstead Program Level (of abstraction). |
Other Metrics
Class Coupling | Measure of the coupling, or dependency, of the class, alternative to CK Class Coupling. Calculation is based on the number of inherited classes, the number of nested classes, the number of calls to static member functions, and the number of parameters and local variables used by class member functions and having a class type. The higher this value, the more effort is required to understand, use and modify the class. |
| To be accurate, data must be collected with the -locals option enabled. |
Derived Classes | Depth of the hierarchy of derived classes of the class. |
External Methods and Coupling | Total number of external classes used and external methods called by class member methods. This is the sum of coupling between classes and external methods called. |
| To be accurate, data must be collected with the -locals option enabled. |
Fan In of Inherited Classes | Number of base classes directly inherited by class. |
Local Methods | Number of local methods (private member functions) of the class. |
Member Attributes | Number of attributes (member variables) of the class. |
Member Classes | Number of nested classes (member classes) of the class. |
Member Types | Number of member typedefs of the class. |
Member Methods | Number of methods (member functions) of the class. |
Methods Called, External | Number of external methods called by class methods. |
Methods Called, Internal | Number of internal methods called by class methods. |
Total Members of Class | Total number of members of the class. |
|