build(sonar): tune quality gate for false positives and fix genuine findings#55
Closed
wolpert wants to merge 1 commit into
Closed
build(sonar): tune quality gate for false positives and fix genuine findings#55wolpert wants to merge 1 commit into
wolpert wants to merge 1 commit into
Conversation
…indings The first SonarCloud analysis flagged the full backlog against new-code thresholds. Overall health already passes (~88% coverage, ~2% duplication); the noise came from rules that conflict with the project's conventions plus a couple of real findings. Triaged all 407 issues and addressed the legitimate ones without deleting correct defensive code. Config (version-controlled, rationale in docs/adr/0017): - Suppress java:S4449 project-wide (demands JSR-305 javax.annotation.Nullable; we standardize on JSpecify, enforced by Error Prone). - Suppress java:S2699 on **/*Test.java (persistence/in-memory suites delegate assertions to shared testkit *Scenarios classes; gated by JaCoCo + mutation). - Exclude DynamoDB *Item beans and module-info.java from coverage (structural SDK-driven POJOs / no executable statements). Genuine fixes: - Annotate Micronaut admin controller @Body params @nullable, matching the Spring adapter, so the existing null-guards are no longer flagged as dead code (java:S2583/S2589) — the framework can inject a null body. - CeremonyScenarios: Optional.orElseThrow() instead of get() (java:S3655). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Contributor
Author
|
Superseded by the SonarQube removal — see new PR. We're dropping SonarQube entirely and enforcing line+branch coverage natively via JaCoCo instead of suppressing false positives. |
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
Tunes the SonarCloud quality gate that went red on the first analysis, and fixes the genuine findings behind it.
The red gate was an onboarding artifact, not a regression. Overall code health already passes every threshold (coverage 88.3%, duplication 2.3%); the gate only failed on
new_*conditions, where the first analysis scored a non-representative slice of the backlog against strict Clean-as-You-Code thresholds. All 407 issues were triaged; the headline counts were dominated by rules that conflict with this project's conventions, not by defects.Changes
Config (
build.gradle.kts, documented in ADR 0017):java:S4449project-wide — it demands JSR-305javax.annotation.Nullable; we standardize on JSpecify, enforced by Error Prone (CONTRIBUTING.md §7).java:S2699on**/*Test.java— the persistence/in-memory suites delegate assertions to shared testkit*Scenariosclasses so one suite runs against every backend; the rule can't see across the call. Test effectiveness is already gated by JaCoCo floors + mutation testing.*Itembeans andmodule-info.javafrom coverage — mandatory SDK-driven POJOs / no executable statements.Genuine code fixes:
@Bodyparams@Nullable, matching the Spring adapter. Micronaut can inject a null body, so the existingbody == nullguards are correct — this clears theS2583/S2589"dead condition" cluster the right way instead of deleting the guards.CeremonyScenarios:Optional.orElseThrow()instead ofget()(S3655).Deliberately not done (would be number-chasing)
Defensive
jti == nullguards, SpringgetPrincipal()(returns a non-null final field), and DynamoDB beanpkfields are false positives on correct/structural code — left as-is.Verification
spotlessCheck, module compilation, and the Micronaut admin controller tests all pass.🤖 Generated with Claude Code