Repository navigation
refactor(complexity): phase 3 — the goast provider methods - #315
Merged
Merged
Conversation
Third phase of the complexity plan (#312): nine functions under the thresholds by behavior-preserving decomposition, including the repo's worst. ConstGroups (70) becomes a named state machine — constGroupsFromDecl with an explicit flush closure, entries via constEntriesFromSpec, its anonymous local types promoted to file-level constEntry/constGroup. Structs (49) extracts structFields/fieldDetailsFrom; Callable (49) and TypeDoc (24) share typeSpecDoc via per-file finders; Methods (38) splits filter from construction; SortDeclarations (24) splits block collection from splicing; Calls (22) and Composites (35) extract their closure bodies; spacingRulesFromConfig (17 gocyclo) goes table-driven over its order-independent fields. The plan's pre-declared structure question is now concrete and recorded in the phase notes: the collectGoFiles+parseFile iteration remains repeated in five methods; a shared per-file walker is available for a ruling, not adopted unilaterally. Zero complexity findings remain in the file; no new findings anywhere; make vet and full make test pass unmodified; gofmt clean. Plan: docs/plans/complexity-refactors.md (phase 3 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 3 of docs/plans/complexity-refactors.md (#312): nine functions decomposed under the thresholds, including the repo's worst (
ConstGroups, 70 → a named state machine with an explicit flush). Behavior-preserving throughout — the suite passes unmodified. The pre-declared structure question is now concrete in the phase notes: five methods still repeat the per-file parse walk; a shared walker awaits a ruling. Plan doc rides along with phase 3 marked complete.