Context
PR #1464 (Stage 1, issue #1077 ) lowered Ruff complexity thresholds from their initial ceilings to intermediate values. Stage 2 should continue ratcheting towards industry-standard McCabe thresholds.
Stage 2 targets
Metric
Stage 1 (current)
Stage 2 target
Industry standard
max-complexity
50
<=20
10-15 (ruff, httpie)
max-branches
60
<=25
12 (default)
max-statements
200
<=100
50 (default)
max-args
15
<=10
5 (default)
max-returns
12
<=8
6 (default)
Scope
Split the 6 files currently over 1400 lines (deferred from Stage 1, MAX_LINES set to 2000 as a compromise):
Identify natural module boundaries in each file
Extract cohesive sub-modules with clean import graphs
Decompose remaining complex functions to meet Stage 2 thresholds
Replace IntegratorBundle Any-typed fields with a BaseIntegrator protocol (panel nit from PR refactor: Strangler Stage 1 -- tame worst complexity outliers #1464 )
Follow-up from PR #1464 panel review
Python Architect: type IntegratorBundle fields properly
OSS Growth Hacker: max-complexity=50 is still 2x contributor-friendly threshold
CLI Logging Expert: align _clean_toml_mcp_config output contract with siblings (partially addressed)
References
Context
PR #1464 (Stage 1, issue #1077) lowered Ruff complexity thresholds from their initial ceilings to intermediate values. Stage 2 should continue ratcheting towards industry-standard McCabe thresholds.
Stage 2 targets
Scope
Split the 6 files currently over 1400 lines (deferred from Stage 1, MAX_LINES set to 2000 as a compromise):
Decompose remaining complex functions to meet Stage 2 thresholds
Replace IntegratorBundle Any-typed fields with a BaseIntegrator protocol (panel nit from PR refactor: Strangler Stage 1 -- tame worst complexity outliers #1464)
Follow-up from PR #1464 panel review
References