| Info | ||||
|---|---|---|---|---|
| ||||
|
What is RFC?
RFC stands for Response For Class. RFC measures the complexity of the class in terms of method calls.
For each class, it counts:
- +1 for each method
- +1 for each call of a distinct method (note that getters and setters are not considered as methods)
Example:
| Code Block | ||||
|---|---|---|---|---|
| ||||
public class ClassA
{
private ClassB classB = new ClassB(); // call (constructor of class B) => +1
public void doSomething(){ // method declaration => +1
System.out.println ( "doSomething"); // call (System.out.println) => +1
}
public void doSomethingBasedOnClassB(){ // method declaration => +1
System.out.println (classB.toString()); // call (System.out.println) => 0 because already counted on line 5 + call (toString) => +1
}
}
// default constructor of ClassA => +1
// RFC = 6 |
How to Hunt for Bad RFC?
Add the Chidamber & Kemerer widget on your dashboard:
and drill down.

