Code Inspection: Suspicious variable/parameter name combination
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it.
Example:
var x = 0;
var y = x;
or
var x = 0, y = 0;
var rc = new Rectangle(y, x, 20, 20);
Here the inspection guesses that x
and y
are mixed up.
Specify the names that should not be used together. An error is reported if a parameter name or an assignment target name contains words from one group while the name of the assigned or passed variable contains words from another group.
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.