Skip to content

refactor: clear SonarCloud's open code-smell findings - #696

Merged
osanderson merged 2 commits into
mainfrom
refactor/sonar-test-complexity
Oct 22, 2026
Merged

osanderson merged 2 commits into
mainfrom
refactor/sonar-test-complexity

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

Clears six of SonarCloud's nine open issues on main, without changing behaviour:

  • server/complete_backchannel_authentication.go: the invalid-handle description, used three times, is one constant (S1192).
  • TestPushAuthorizationRequestBoundsPrompt, TestPushAuthorizationRequestRefusesResponseTypesOtherThanCode and FuzzNumericDateParse move their checks into helpers, under the cognitive complexity limit of 15 (S3776). The tests check exactly what they did before.
  • FuzzNumericDateParse's floor check uses < instead of a negated >= (S1940); JSON has no NaN, so the two are the same.
  • A federation test compares errors.Is directly rather than through a variable (S8193).

The other three (S8196: pairwise.HMACOps, pairwise.Lookup, server.ResourcePolicy not named "-er") are released public API; renaming them would be a breaking change only for a naming convention, so they stay as they are.

🤖 Generated with Claude Code

osanderson and others added 2 commits October 23, 2026 02:57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o helpers

TestPushAuthorizationRequestBoundsPrompt,
TestPushAuthorizationRequestRefusesResponseTypesOtherThanCode and
FuzzNumericDateParse each move their checks into helpers, under
SonarCloud's cognitive complexity limit. The fuzz target's floor check
reads "<" instead of a negated ">=" (JSON has no NaN), and a federation
test compares errors.Is directly. No test changes what it checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@osanderson
osanderson merged commit 66083b3 into main Oct 22, 2026
18 checks passed
@osanderson
osanderson deleted the refactor/sonar-test-complexity branch October 22, 2026 19:12
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