Inspectopedia Help

Control flow issues

'case' statement without 'else' block  

Reports case statements without else blocks.

'unless' statement with 'else'  

Reports unless statements used with else.

Incorrect context for jump statement  

Reports the incorrect use of control flow jump statements, such as return, retry, redo, break, and continue.

Negative condition in control flow statement  

Reports control flow statements with negative conditions.

Nested ternary operator  

Reports nested ternary operators.

Simplifiable 'if' statement  

Reports if statements that can be replaced with case statements.

Unconventional 'for' loop  

Reports usages of for loops.

Last modified: 18 June 2024