Inspectopedia Help

NoOp Code

NoOp Code

This check looks for code which looks like it's a no-op -- usually leftover expressions from interactive debugging, but in some cases bugs where you had intended to do something with the expression such as assign it to a field.

Issue id: NoOp

Available options:

pure-getters (default is false):

Whether to assume methods with getter-names have no side effects.

Getter methods (where names start with get or is, and have non-void return types, and no arguments) should not have side effects. With this option turned on, lint will assume that is the case and will list any getter calls whose results are ignored as suspicious code.

To configure this option, use a lint.xml file with an <option> like this:

<lint> <issue id="NoOp"> <option name="pure-getters" value="false" /> </issue> </lint>

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3

Plugin:

Android, 2022.3.1 Beta 2

Last modified: 13 July 2023