Skip to content

refactor(complexity): split _publish_snapshots & _build_report (#1131 batch 1)#1197

Merged
axisrow merged 1 commit into
mainfrom
fix/1131-batch1-complexity
Jun 29, 2026
Merged

refactor(complexity): split _publish_snapshots & _build_report (#1131 batch 1)#1197
axisrow merged 1 commit into
mainfrom
fix/1131-batch1-complexity

Conversation

@axisrow

@axisrow axisrow commented Jun 29, 2026

Copy link
Copy Markdown
Owner

What

#1131 batch 1 of ~4 (axis 1/7 of the #1130 tech-debt epic: cyclomatic complexity). Behaviour-preserving split of two isolated rank-E functions into private sub-methods.

Function Before After
runtime/worker.py::_publish_snapshots E(40) out of rank-E
filters/analyzer.py::ChannelAnalyzer._build_report E(32) out of rank-E

code_health.py rank-E count 8 → 6; average complexity unchanged.

No behaviour change — proven

The one-off AST verification script was used as proof and not committed (it's batch-1-specific scaffolding, not a reusable guard). Equivalence is re-checkable from the diff.

Part of #1131 (remaining batches: cli/test funcs; start_container + _dispatch_stream_message hot paths; _pipeline_add + generate).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TShpckA1DoLNezbD3txTL1

…E → ≤C)

#1131 batch 1 (axis 1/7, complexity). Behaviour-preserving extraction of two
isolated rank-E hot functions into private sub-methods; the remaining function
body is a sequence of calls.

- runtime/worker.py::_publish_snapshots  E(40) → out of rank-E
- filters/analyzer.py::ChannelAnalyzer._build_report  E(32) → out of rank-E

code_health rank-E count 8 → 6; average complexity unchanged. No behaviour
change: proven by AST-equivalence of the extracted bodies vs the originals
(per #1046's diff-harness — all analyzer/worker blocks reported equivalent) plus
green characterising tests (tests/test_filters.py + tests/test_runtime_worker.py,
72 passed). #1172's TimeoutError branch in _publish_snapshots preserved.

Part of #1131

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TShpckA1DoLNezbD3txTL1
@axisrow axisrow merged commit 7a9ef80 into main Jun 29, 2026
4 checks passed
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