When two methods have the same implementation, either it was a mistake - something else was intended - or the duplication was intentional, but may be confusing to maintainers. In the latter case, one implementation should invoke the other.

Noncompliant Code Example

private final static String CODE = "bounteous";

public String getCode() {
  return CODE;
}

public String getName() {  // Noncompliant
  return CODE;
}

Compliant Solution

private final static String CODE = "bounteous";

public String getCode() {
  return CODE;
}

public String getName() {
  return getCode();
}

Exceptions

Methods that are not accessors (getters and setters), with fewer than 2 statements are ignored.