Skip to content

refactor: reduce CLI complexity + vulture whitelist (97→98 A)#1

Closed
hummbl-dev wants to merge 1 commit intomainfrom
refactor/claude/complexity-reduction
Closed

refactor: reduce CLI complexity + vulture whitelist (97→98 A)#1
hummbl-dev wants to merge 1 commit intomainfrom
refactor/claude/complexity-reduction

Conversation

@hummbl-dev
Copy link
Copy Markdown
Owner

Summary

Extract helpers from 4 high-CC CLI handlers to reduce cyclomatic complexity. Add vulture whitelist for false-positive dead code findings.

Changes

  • __main__.py: Extract 8 helpers from cmd_analyze, cmd_triage, cmd_fix
  • dead_code_analyzer.py: Auto-detect vulture_whitelist.py in repo root
  • vulture_whitelist.py: Known false positives (HTTP overrides, public API, dataclass fields)
  • Fix E701 one-liner style violations

Score Impact

  • Before: 62.1 (D) — 106 findings (91 vulture false positives)
  • After: 98.0 (A) — 4 findings (3 complexity, 1 ruff)
  • Complexity: 6 → 3 findings (95.9)

Test plan

  • 78 tests pass
  • ruff clean
  • Self-score: 98.0 (A)

🤖 Generated with Claude Code

Extract helpers from 4 high-CC CLI handlers in __main__.py:
- cmd_analyze: _parse_exclude, _persist_file_quality, _score_commits, _print_analyze_summary
- cmd_triage: _classify_repo, _print_triage
- cmd_fix: _run_ruff_fix, _print_fix_delta
- Fix E701 one-liners in _print_fleet_report

Add vulture_whitelist.py for known false positives (HTTP handler
overrides, public API methods, dataclass fields).

Dead code analyzer now auto-detects vulture_whitelist.py in repo root.

Score: 62.1 (D) → 98.0 (A) | Complexity: 6→3 findings | Vulture: 91→0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hummbl-dev
Copy link
Copy Markdown
Owner Author

Closing — conflicts with #2 (report generator) which included overlapping CLI changes. Complexity reduction already landed via hummbl-agent Arbiter quality push.

@hummbl-dev hummbl-dev closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant