Sunteți pe pagina 1din 7

The CK Metrics Suite

Weighted Methods Per Class


Compute the complexity of the method ,

using a specific complexity measure (cyclomatic complexity). Compute it for all the methods in the class WMC is the average of all the complexities of the methods.

Depth of Inheritance Tree

An Example of this is as follows,

It is the length of the longest path from any class to the root of the tree.

In the preceding example, DIT is 3.

Number of Children

NOC is the number of immediate derived classes from any given class In the preceding example, the number of children for C2 is 3 (C21, C22, C23).

Coupling between Object Classes

CBO is simply the number of classes that are coupled to a specific class.

Lack of Cohesion in Methods

Measures the dissimilarity of methods in a class via instanced variables.


LCOM represents how closely the local methods are related to the instance variables in a class.

CK Metrics Summary
Weighted Depth

Methods Per Class (WMC)

of Inheritance Tree (DIT) of Children (NOC) between Object Classes

Number

Coupling

(CBO)
Lack

of Cohesion in Methods (LCOM): 5

S-ar putea să vă placă și