There are valid cases for passing a variable multiple times into the same method call, but usually doing so is a mistake, and something else was intended for one of the arguments.
if (compare(myPoint.x, myPoint.x) != 0) { // Noncompliant //... } if (compare(getNextValue(), getNextValue()) != 0) { // Noncompliant // ... }
if (compare(myPoint.x, myPoint.y) != 0) { //... } Object v1 = getNextValue(); Object v2 = getNextValue(); if (compare(v1, v2) != 0) { // ... }
This rule is deprecated, and will eventually be removed.