Back to Intellij Community

OverlyComplexArithmeticExpression

java/java-impl/resources/inspectionDescriptions/OverlyComplexArithmeticExpression.html

2025.3-rc-2453 B
Original Source

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.