Field is Used as Temporary Variable (FUTV)

Description:

FUTV detects fields that are used as temporary variables. This means that a value assigned to such a field is not used by any method except for the method containing the assignment. A temporary field should be replaced by a local variable. FUTV examines only fields with private and default access since public and protected fields may be used outside the analyzed package.

Example:

   class C {
       int i;

       void f() {
           for (i = 0; i < 10; i++) {
               ...
           }
       }

       void g() {
           i = 0;
           ...
       }
   }