Repository navigation
refactor(complexity): phase 4 — goast analysis and serialization - #316
Merged
Merged
Conversation
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).
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.
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.