Skip to content

lint(migrate): delete a dead complexity directive, argue the live one - #387

Merged
David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-writ-migrate
Aug 12, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
refactor/complexity-writ-migrate

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Phase 1b-iv of issue #365 — the last active 1b item. Comment-only: no behavior changes, no signatures.

The two items

  1. applyGraphModifications loses its //nolint:gocognit. The function measures gocognit 8 against a threshold of 20 — the directive suppressed nothing, and a suppression that suppresses nothing is misinformation for the next audit.
  2. buildTree (gocognit 23) keeps its suppression, argued. One WalkDir filter: a guard chain whose branches return distinct sentinels (SkipDir vs nil). It is already flat, so flattening does not apply, and extraction would split one coherent filter across functions — harder to read, not easier. The directive now carries that reason in the repository's argued-suppression form.

Phase 1b closes

Bare nolint directives: 3 → 1. The survivor is buildMultiSource, deliberately parked on #369 — its collision predicate's only reachable branch has undefined behavior under the current unstable sort, so no behavior-preserving refactor of it exists to write.

Final accounting of the audit's nine live complexity suppressions:

Disposition Functions
Decomposed runOnboard, generateManifest, promptForProvider, main (devlore-index) — plus their nine tested helpers
Deleted as dead applyGraphModifications (here), plus bindgen's two with their file (#386)
Argued buildTree (here)
Parked on #369 buildMultiSource

Verified: make vet, full make test green (zero FAIL/panic by count), gofmt clean.

Phase 1b-iv of the issue #365 audit remediation — the last active 1b item, and
comment-only: no behavior changes, no signatures touched.

applyGraphModifications loses its //nolint:gocognit. The function measures
gocognit 8 against a threshold of 20; the directive suppressed nothing, and a
suppression that suppresses nothing is misinformation for the next audit.

buildTree (gocognit 23) keeps its suppression, converted to the argued form the
repository's convention requires: one WalkDir filter, a guard chain whose
branches return distinct sentinels (SkipDir vs nil), where splitting the chain
across helpers fragments a single coherent filter. The verdict from the
per-function ruling: flattening does not apply (it is already flat) and
extraction makes it harder to read, not easier.

Bare nolint directives across the tree: 3 -> 1. The survivor is
buildMultiSource, deliberately parked on issue #369 — its collision predicate's
only reachable branch has undefined behavior under the current unstable sort,
so no behavior-preserving refactor of it exists to write.

Final accounting for the audit's nine live complexity suppressions: six
decomposed (1b-i, 1b-ii), one deleted as dead-on-a-live-function (this commit),
one argued (this commit), one parked on the #369 correctness bug. Phase 1b's
active work is closed.

Verified: make vet green, full make test green — zero FAIL or panic lines by
count; gofmt clean.
Plan: docs/plans/audit-remediation.md (phase 1b-iv, flipped to completed here).
Issue: #365
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 12, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 4574fdb into develop Aug 12, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the refactor/complexity-writ-migrate branch August 12, 2026 17:48
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