Skip to content

refactor(complexity): phase 2 — star app and the shellcheck provider - #314

Merged
David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-star-app
Aug 3, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-star-app

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Phase 2 of docs/plans/complexity-refactors.md (#312): seven functions decomposed under gocognit 20 / gocyclo 15, behavior-preserving — the suite passes unmodified. Highlights: flagValue's 24-case switch splits by type family; shellcheck's scanner state becomes a functionTracker with per-line branchDelta accounting (its nesting quirks preserved exactly); Command.Run's extraction was itself over threshold and split again (applyPositionalArgs). Plan doc rides along with phase 2 marked complete.

Second phase of the complexity plan (#312): seven functions under the
thresholds by behavior-preserving decomposition.
registerStarlarkCommand (37) extracts its four stages
(findOrCreateParent, useLineFor, collectFlagValues, defineFlags);
Extension.Validate (30) dispatches per command with arg/flag validators;
Command.Run (30) extracts buildArgsDict — split once more when the
extraction itself scored 23, applyPositionalArgs carrying the
positional switch — and setCurrentCommand; flagValue's 24-case switch
(26 gocyclo) splits into integer/scalar/collection extractors with a
stated fallback chain. shellcheck's parseShellFile (32) moves its
scanner state into a functionTracker.observe method and match recording
into recordLineMatches; calculateFunctionComplexity (26) extracts
branchDelta + countParameterRefs, preserving the case-opens-nothing /
esac-closes-floored quirk exactly; isValidFunctionName (17 gocyclo)
reads through positive rune predicates.

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