If statement with too many branches
Reports if
statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.
Example:
if (a) {
print "foo"
} else if (b) {
print "bar"
} else if (c) {
print "baz"
} else if (d) {
print "Too many branches"
}
Use the Maximum number of branches field to specify the maximum number of branches expected.
Inspection options
Option | Type | Default |
---|---|---|
Maximum number of branches | Number | 3 |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Groovy, 233.SNAPSHOT |
Last modified: 13 July 2023