Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ-Idea disable inspection: Actual value of parameter is always

Is there a way to disable this inspection? I know, this maybe be a bad design, but I still would like to disable it.

like image 338
yu.pitomets Avatar asked Jan 03 '19 16:01

yu.pitomets


People also ask

How do I turn off code analysis in IntelliJ?

Disable an inspection in the settingsIn the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Inspections. Locate the inspection you want to disable, and clear the checkbox next to it. Apply the changes and close the dialog.

How do I enable code analysis in IntelliJ?

Press Ctrl+Alt+S or choose File | Settings (Windows and Linux) or JetBrains Rider | Preferences (macOS) from the menu , then choose Editor | Inspection Settings on the left. Use the Enable code analysis checkbox to toggle the design-time code inspection.


2 Answers

Find an instance of the inspection, and hit ALT+ENTER to open the content menu. You'll see a suggestion there that looks like "Inline value 'XYZ' for parameter 'myParameter'". Click the right arrow next to it to open a second context menu, and there you'll find options to edit the inspection setting in order to tune the conditions that will produce it, suppress it for the method/class/parameter, or even disable it altogether.

like image 139
Mureinik Avatar answered Sep 20 '22 14:09

Mureinik


@SuppressWarnings("SameParameterValue")

I tested it in Android Studio 3.5, which is based on IntelliJ-Idea, so it probably works in other IntelliJ-Idea based IDEs too.

like image 28
pintergabor Avatar answered Sep 19 '22 14:09

pintergabor