Sonar burn-down, mechanical batch: 98 findings, no behaviour change - #14
Merged
Conversation
Backend
- tests: split 60 composite `assert a and b` into separate asserts (S9073);
keep only the throwing call inside pytest.raises (S5778).
- auth: document the 401/429/503 HTTPExceptions on /verify via
`responses=` (S8415); drop `response_model=` where it duplicates the
return annotation on /session and /api/health (S8409).
- parse: `_as_str_tuple` builds one list and returns once (S8495).
Frontend
- Wrap every component's props type in Readonly<> (S6759), including the
shadcn ui/* components.
- Stable list keys instead of array indexes (S6479): AST rows carry a tree
path from flattenAst; scope outline and other content rows use a small
`keyed()` helper that suffixes repeated content instead of indexing.
- String.raw for backslash-heavy literals (S7780), replaceAll over
regex replace (S7781), SubmitEvent instead of the deprecated FormEvent
(S1874), un-nest a template literal in AttackCard (S4624), drop a
useless `?? {}` spread in api.ts (S7744).
- tsconfig.node.json: remove the /* */ comments so it is strict JSON
(json:S2260).
deploy.sh: `[[ ]]` for the health-check test (S7688).
Left for a later pass, by decision: the seven cognitive-complexity
refactors (S3776) and the sixteen nested ternaries (S3358).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SonarCloud analysis · PR #14Quality gate: ❌ Failed · Open in SonarCloud
Open issues on new code: 0No open issues on the changed code. 🎉 Commit |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
First of two SonarCloud burn-down passes on
main(121 open, all maintainability). This PR takes the mechanical, behaviour-preserving 98 and leaves the 7 cognitive-complexity refactors (S3776) and 16 nested ternaries (S3358) for a separate reviewed pass, per the decision to accept those for now.Backend
assert a and bsplit into separate asserts (S9073); only the throwing call stays insidepytest.raises(S5778).auth.py:/verifydocuments its 401/429/503 responses (S8415); redundantresponse_model=dropped on/sessionand/api/health(S8409). OpenAPI output verified unchanged.parse.py:_as_str_tuplebuilds one list and returns once (S8495).Frontend
Readonly<>(S6759), including the shadcnui/*components.pathfromflattenAst; scope outline and other content rows use a smallkeyed()helper that suffixes repeated content rather than indexing.String.rawfor backslash-heavy literals (S7780),replaceAll(S7781),SubmitEventfor the deprecatedFormEvent(S1874), un-nested template literal inAttackCard(S4624), useless?? {}spread removed (S7744).tsconfig.node.jsonis strict JSON again (json:S2260).Other:
deploy.shuses[[ ]]for the health-check test (S7688).Verification
pytest201 passed.tsc --noEmitclean,vitest20 passed (one new test forkeyed()).mainafter merge should drop from 121 to roughly 23.🤖 Generated with Claude Code