scitools.com

← Metric catalog

Coupled 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.

Coupled Classes

API ID: CountClassCoupled
Also Known As: Coupling Between Objects (CBO)
Languages: Basic, C#, C++, Java, Pascal, Python
Targets: Classes

Number of other classes coupled to.

The Coupling Between Object Classes (CBO) measure for a class is a count of the number of other classes to which it is coupled. Base classes and nested classes are not counted. Class A is coupled to class B if class A uses a type, data, or member from class B. This metric is also referred to as Efferent Coupling (Ce). Any number of couplings to a given class counts as 1 towards the metric total.

Chidamber & Kemerer suggest that:
1) Excessive coupling between object classes is detrimental to modular design and prevents reuse.
2) Inter-object class couples should be kept to a minimum.
3) The higher the inter-object class coupling, the more rigorous testing needs to be.

Also known as Chidamber & Kemerer - Coupling Between Objects (CBO).


Targets By Language: Configuration: