refactor/doctor: split Run and suppressWalk into helpers #90

Merged
pti merged 2 commits from refactor/complexity-doctor into main 2026-10-19 22:28:20 +02:00
Owner

Part of #71, the doctor slice. Run was at Sonar cognitive complexity 39 and suppressWalk at 30. Run now delegates to registryAbort, candidateChecks, recordSkip, recordResult and locateFinding, and suppressWalk to suppressWalkMapping, suppressWalkSequence and a shared suppressAppend. Finding ids, messages, ordering and the exhaustive yaml kind switch are unchanged, existing doctor and render golden tests pass untouched, coverage of every new helper is 80 percent or above. poolStripJSONC in the same package is handled by the cmd slice, which merges it with its identical twin in cmd. 🤖 Generated with Claude Code

Part of #71, the doctor slice. Run was at Sonar cognitive complexity 39 and suppressWalk at 30. Run now delegates to registryAbort, candidateChecks, recordSkip, recordResult and locateFinding, and suppressWalk to suppressWalkMapping, suppressWalkSequence and a shared suppressAppend. Finding ids, messages, ordering and the exhaustive yaml kind switch are unchanged, existing doctor and render golden tests pass untouched, coverage of every new helper is 80 percent or above. poolStripJSONC in the same package is handled by the cmd slice, which merges it with its identical twin in cmd. 🤖 Generated with Claude Code
refactor(doctor): split Run and suppressWalk into helpers
All checks were successful
Lint / lint (pull_request) Successful in 56s
Lint / sonarqube (pull_request) Has been skipped
73b90efb18
Sonar go:S3776 flagged Run (39) and suppressWalk (30) above the
cognitive-complexity threshold of 25. Run's per-result bookkeeping,
registry gate, candidate-list preparation and skip recording move into
named helpers; suppressWalk's mapping-key and sequence-item placements
move into their own walkers sharing one directive-append helper.

Behaviour-neutral: finding ids, messages, ordering and exit-code
mapping are unchanged and the existing tests are the guard.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge branch 'main' into refactor/complexity-doctor
All checks were successful
Lint / lint (pull_request) Successful in 1m12s
Lint / sonarqube (pull_request) Has been skipped
5712778883
pti merged commit 33545eb041 into main 2026-10-19 22:28:20 +02:00
pti deleted branch refactor/complexity-doctor 2026-10-19 22:28:20 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!90
No description provided.