Inspectopedia
 
2024.3

Maximum 'switch' branches

Warning
New
Last modified: 03 December 2024

Reports switch statements or expressions with too many case labels.

Such a long switch statement may be confusing and should probably be refactored. Sometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants).

Example:

Use the Maximum number of branches field to specify the maximum number of case labels expected.