max-statements
Warns when the number of statements in a function exceeds the configured threshold.
⚙️ Config
Set max-number (default is 20) to configure the maximum number of statements in a function.
analysis_options.yaml
dcm:
rules:
- max-statements:
max-number: 20
Example
❌ Bad:
// LINT: This function has too many statements (25). Maximum allowed is 20.
// Try reducing the number of statements.
void fn() {
... // 25 statements
}
✅ Good:
void fn() {
... // 15 statements
}