refactor(complexity): split _publish_snapshots & _build_report (#1131 batch 1)#1197
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
runtime/worker.py::_publish_snapshotsfilters/analyzer.py::ChannelAnalyzer._build_reportcode_health.pyrank-E count 8 → 6; average complexity unchanged.No behaviour change — proven
tests/test_filters.py(10+ChannelAnalyzer.analyzecases) +tests/test_runtime_worker.py→ 72 passed isolated.except asyncio.TimeoutErrorbranch in_publish_snapshotsis preserved.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