Reports assignments and function calls where the name of the target variable or the function parameter does not match the name of the value assigned to it.

Example:

  int x = 0;
  int y = x; // x is used as a y-coordinate
or

  int x = 0, y = 0;
  // x is used as a y-coordinate and y as an x-coordinate
  Rectangle rc = new Rectangle(y, x, 20, 20);

The first panel below allows to specify the names which should not be used together: an error is reported if the parameter name or assignment target name contains words from one group and the name of the assigned or passed variable contains words from a different group.

The second panel below allows to specify methods that should not be checked but do have a potentially suspicious name. For example the Integer.compare() parameters are named x and y, but are unrelated to coordinates.