The sonar documentation shows the following as a refactored code of LCOM4 = 1. But it seems to me that it should be 2, because there is no cohesion between getFullName
and getFullAddress
. What am I missing?
public class Client {
public String firstname;
public String lastname;
public Address address;
public String getFullName() {
return firstname + " " + lastname;
}
public String getFullAddress() {
return address.getFullAddress();
}
}