Repository navigation
lint(migrate): delete a dead complexity directive, argue the live one - #387
Merged
Merged
Conversation
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
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 1b-iv of issue #365 — the last active 1b item. Comment-only: no behavior changes, no signatures.
The two items
applyGraphModificationsloses 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, argued. OneWalkDirfilter: a guard chain whose branches return distinct sentinels (SkipDirvsnil). 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
nolintdirectives: 3 → 1. The survivor isbuildMultiSource, 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:
runOnboard,generateManifest,promptForProvider,main(devlore-index) — plus their nine tested helpersapplyGraphModifications(here), plus bindgen's two with their file (#386)buildTree(here)buildMultiSourceVerified:
make vet, fullmake testgreen (zero FAIL/panic by count),gofmtclean.