TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  UnusedCode1Checked automatically with code checker

Synopsis:Avoid unused private fields
Language:Java
Severity Level:4
Category:UnusedCode


Description:
Detects when a private field is declared and/or assigned a value, but not used.
public class Something {
  private static int FOO = 2; // Unused
  private int i = 5; // Unused
  private int j = 6;
  public int addOne() {
    return j++;
  }
}