Inspectopedia
 
2024.3

Cascade 'if' can be replaced with 'when'

Info
New
Last modified: 03 December 2024

Reports if statements with three or more branches that can be replaced with the when expression.

Example:

The quick-fix converts the if expression to when: