15
6
DO limit the number of cases in a switch statement or switch expression.
To enable the max_switch_cases rule, add max_switch_cases under rules in your analysis_options.yaml file:
max_switch_cases
rules
analysis_options.yaml
custom_lint: rules: - max_switch_cases
max_cases
int
10
To configure the maximum number of cases, add an int to the max_cases option:
custom_lint: rules: - max_switch_cases: max_cases: 5