Skip to content

refactor(complexity): phase 4 — goast analysis and serialization - #316

Merged
David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-goast-analysis
Aug 4, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-goast-analysis

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Phase 4 of docs/plans/complexity-refactors.md (#312): eight functions decomposed under the thresholds — LoadSourceFile (67) along its own commented phases, analyzeFileMetrics (55) into line/declaration counters, assignSlots (44) into the algorithm's named parts (naturally retiring its two inline G602 proofs), schemaFromConfigVal (43) table-driven. Behavior-preserving; the suite passes unmodified. goast is now complexity-clean. Plan doc rides along with phase 4 marked complete.

Fourth phase of the complexity plan (#312): eight functions under the
thresholds by behavior-preserving decomposition. LoadSourceFile (67)
decomposes along its own commented phases — comment-group
classification (split twice: the first extraction scored 27),
declaration loading, floating-comment collection, method association —
its anonymous types promoted to positionedDecl/pendingMethod. SaveAs
(29) extracts the preamble rule and declaration emission.
analyzeFileMetrics (55) splits line counters from per-declaration
counters. assignSlots (44) becomes the algorithm's named parts
(buildScoreMatrix, bestFreePair, forcedMatch, freeStrings), retiring
the two inline G602 proofs naturally. schemaFromConfigVal (43) goes
table-driven over a shared reflectStringFields. typeToString (37)
extracts its func/chan arms; checkLineWidth (32) its under-fill
analysis behind one commentPairExempt predicate; itemProduction.Execute
(23) its consume predicate and in-place sentence split.

Zero complexity findings remain in goast; no new findings anywhere;
make vet and full make test pass unmodified; gofmt clean.
Plan: docs/plans/complexity-refactors.md (phase 4 complete).
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 4, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 804431a into develop Aug 4, 2026
2 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the refactor/complexity-goast-analysis branch August 4, 2026 00:46
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