Overly complex arithmetic expression
Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors.
Parameters, field references, and other primary expressions are counted as a term.
Example:
int calc(int a, int b) {
return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.
}
Use the field below to specify a number of terms allowed in arithmetic expressions.
Inspection options
Option | Type | Default |
---|---|---|
Maximum number of terms | Number | 6 |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023