Skip to content

Strangler Stage 1: tame the worst outliers #1077

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

Strangler Stage 1: tame the worst outliers

Labels: good first issue, code-quality, refactor


Stage 1 -- tame the worst outliers

Tighten Ruff thresholds from baseline to Stage 1 targets. This stage focuses on the small number of extreme outliers that gate every metric.

Threshold changes

Metric Current Stage 1 Violations Files
max-statements 275 200 1 1
max-branches 115 60 1 1
max-complexity 100 50 2 2
max-args 18 15 5 4
max-returns 18 12 4 4
file-length 2400 1400 3 3

Key files to refactor

mcp_integrator.py::install (owns 3 metrics simultaneously):

  • 269 statements (target: 200)
  • 108 branches (target: 60)
  • 97 complexity (target: 50)
  • Extract phases into private helpers (_validate, _resolve, _deploy, _hooks)

install/validation.py (complexity 65, target 50)

commands/install.py (18 args on two functions, target 15):

  • Reduce via parameter objects or context dataclasses

marketplace/publisher.py (16 returns, target 12):

  • Early-return consolidation

File length (3 files > 1400 lines):

  • github_downloader.py (2316), commands/install.py (1680), skill_integrator.py (1365)

How to verify

# Update thresholds in pyproject.toml, then:
uv run ruff check src/ tests/

# Update MAX_LINES in .github/workflows/ci.yml, then check:
find src/ -name '*.py' | xargs wc -l | awk '$1 > 1400'

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ci-cdGitHub workflows, merge queue, gh-aw integrations, release pipeline.area/cliCLI command surface, flags, help text (cross-cutting).code-qualityCode quality, linting, and complexity guardrailsgood first issueGood for newcomerspriority/lowAccepted but not time-sensitiverefactorDeprecated: use type/refactor. Kept for issue history; will be removed in milestone 0.10.0.status/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).type/refactorInternal restructure, no behavior change.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions