Coupled Classes Modified 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 Modified
| API ID | CountClassCoupledModified |
| Targets | Classes |
| Languages | Basic C# Java Pascal Python |
| Categories | Coupling Object Oriented |
| Cost | Slow |
Number of other non-standard classes coupled to.
Same as Coupled Classes (Chidamber & Kemerer's CBO), except coupling to standard-library classes doesn't count — only coupling to other user-defined classes does.
For example:
class Helper {
public int value;
public void doWork() {
value++;
}
}
class Coupler {
public void useHelper() {
Helper h = new Helper();
h.doWork();
java.util.ArrayList<String> list = new java.util.ArrayList<String>();
list.add("test");
System.out.println(list.size());
}
}
Coupler uses a type, data, or member from five different classes: the user-defined Helper, plus four standard-library ones (java.util.ArrayList, String, System, and java.io.PrintStream, the last used implicitly via System.out), giving CountClassCoupled = 5. Only Helper is non-standard, so CountClassCoupledModified = 1.
See Coupled Classes to also count coupling to standard-library classes.
Targets By Language:- Basic: Class, Struct
- C#: Class, Struct
- Java: Class, Interface
- Pascal: Class, Interface
- Python: Class