Skip to content

Strangler Stage 2: tighten to industry-standard complexity thresholds #1466

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

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

  1. 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
  2. Decompose remaining complex functions to meet Stage 2 thresholds

  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions