Inspectopedia
 
2024.3

Control flow with empty body

Warning
New
Last modified: 03 December 2024

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.

Example: