Method with multiple return points
Reports methods with too many return points. Methods with too many return points may be confusing, and hard to refactor.
Example:
int foo(int a) {
if (a > 0) {
return a
}
if (a < 0) return -a
return 0
}
Use the field provided below to specify the maximum acceptable number of return points a method might have.
Inspection options
Option | Type | Default |
---|---|---|
Return point limit | Number | 1 |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Groovy, 233.SNAPSHOT |
Last modified: 13 July 2023