Suspicious variable/parameter name combination
Reports assignments and function calls in which the name of the target variable or the function parameter does not match the name of the value assigned to it.
Example 1:
Example 2:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
SuspiciousNameCombination- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Configure the inspection:
Use the Group of names area 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.
Use the Ignore methods area to specify the methods that should not be checked but have a potentially suspicious name. For example, the Integer.compare() parameters are named x and y but are unrelated to coordinates.
Inspection options
Here you can find the description of settings available for the Suspicious variable/parameter name combination inspection, and the reference of their default values.
- Groups of names (comma-separated)
Default value:
[x,width,left,right, y,height,top,bottom]- Ignore methods
Default value:
None
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |