Skip to content

refactor: bring the last three C blocks below 11 (#87) - #91

Merged
tschm merged 1 commit into
mainfrom
rhiza_fix_87_20261008
Oct 8, 2026
Merged

tschm merged 1 commit into
mainfrom
rhiza_fix_87_20261008

Conversation

@tschm

@tschm tschm commented Oct 8, 2026

Copy link
Copy Markdown
Member

Fixes #87.

Done when: radon cc jq_collector -s --show-closures -nc prints nothing, and the 100% line and branch floor still holds.

radon cc jq_collector -s --show-closures -nc now prints nothing: there are no C-ranked blocks left in the package, closures included. Average CC is 3.91.

Block Before After
github_payloads.active_workflow_names C 12 B 7. Delegates to _display_name (A 3) and _disambiguated (B 6, with a doctest)
GitHub.latest_runs C 11 B 7. The feed-backfill loop moved to _backfill (A 4)
metrics._add_local C 11 A 1. Split into _add_working_copy (A 3) and _add_upstream (B 9), then _add_size as before

Behaviour is unchanged.

  • _disambiguated keeps the old rule. Every id that shares a name with another takes its path, and an id with no path keeps its name.
  • _backfill walks the active workflows in listing order, as the old loop did. An earlier draft used a set difference, which would have reordered backfilled workflows on the board. I caught that before committing.
  • The _add_local split doesn't change the exposition. Each metric family collects its own samples, and the golden metrics test passes unchanged.
  • The new helper is named _add_upstream, not _add_drift, because metrics.py already has an _add_drift for template drift.

Gates

  • prek run --all-files: all hooks pass.
  • mypy (strict): clean.
  • pytest: 477 passed on 3.12 and 3.11, 100% of lines and branches.
  • radon mi: lowest is gitlab.py at 42.9.

Closes #87

🤖 Generated with Claude Code

@tschm
tschm merged commit ec90cc6 into main Oct 8, 2026
6 checks passed
@tschm
tschm deleted the rhiza_fix_87_20261008 branch October 8, 2026 13:54
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.

Bring the three remaining C blocks below 11 (closures counted)

1 participant