Inspectopedia Help

Control flow issues

'break' statement  

Reports break statements outside of switch statements.

'continue' statement  

Reports continue statements.

'return' statement can be implicit   New in this release

Reports return statements at the end of closures which can be made implicit.

Constant conditional expression  

Reports conditional expressions with boolean constant as a condition.

Constant if statement   New in this release

Reports if statements with boolean constant as a condition.

Fallthrough in 'switch' statement  

Reports fallthrough in switch statements.

Final variable access   New in this release

Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields.

If statement with identical branches   New in this release

Reports if statements with identical "then" and else branches.

If statement with too many branches   New in this release

Reports if statements with too many branches.

Loop statement that doesn't loop  

Reports for or while statements whose bodies are guaranteed to execute at most once.

Redundant 'if' statement  

Reports if statements which can be simplified to single assignment or return statements.

Redundant conditional expression  

Reports ternary conditional operators of the form x ? true : false or similar, which can be trivially simplified.

Switch statement with no default case   New in this release

Reports switch statements that do not contain default labels.

Ternary expression can be replaced with elvis expression   New in this release

Reports ternary expressions which can be replaced by an elvis expression.

Ternary expression can be replaced with safe call   New in this release

Reports ternary expressions which can be replaced by a safe call.

Ternary expression with identical branches   New in this release

Reports ternary expressions with identical "then" and "else" branches.

Unnecessary 'continue' statement  

Reports continue statements if they are last reachable statements in the loop.

Unnecessary 'return' statement  

Reports return statements at the end of constructors and methods returning void.

Last modified: 11 September 2024