Inspectopedia Help

Control flow with empty body

Reports if, while, do or for statements with empty bodies.

While occasionally intended, this construction is confusing and often the result of a typo.

The quick-fix removes a statement.


if (a > b) {}

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Kotlin, @snapshot@

Last modified: 13 July 2023