fix(build): restore SpotBugs quality gate on main (RAN-26)#68
Merged
Conversation
Clears the 13 Medium SpotBugs findings that were failing the gate on main: - DLS_DEAD_LOCAL_STORE x6 — drop unused `isIndex`/`isEnrich` locals in CodeIqApplication; drop dead `fileInventory`/`recoveredEdges` locals and the unused `buildFileInventory()` helper (plus its now orphaned `FileEntry`/`FileInventory`/`FileClassification` imports) in Analyzer; drop dead `flushed`/`recoveredEdges` locals in EnrichCommand (replace with a comment documenting why the flush + flushDeferred side effects must still run). - REC_CATCH_EXCEPTION — narrow EnrichCommand top-level catch to `IOException | RuntimeException` so unexpected checked types surface instead of being silently caught. - DE/SF (swallow) — FileDiscovery.addGitDiscoveredFile now logs the skipped path and IOException cause at debug before returning. - CT_CONSTRUCTOR_THROW x2 — mark AnalysisCache final so the partially-constructed-instance escape path is no longer reachable. - UC_USELESS_OBJECT x3 — remove the unread `allDetected`/`hookNames` set in ReactComponentDetector, the unread `methodPositions` set in GoStructuresDetector, and the unread `edgeKinds` map in TopologyService#blastRadius. No behavioural changes; all removals are of values/objects that were written but never read, and the catch change only widens what propagates. `mvn spotbugs:check` passes with `BugInstance size = 0`. Co-authored-by: BackendEngineer (Paperclip agent b94a8dd0) Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
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.




Summary
Restores the SpotBugs quality gate on
main—mvn spotbugs:checkwas failing with 13 Medium findings oncab71a4before this change. All 13 findings are fixed in-place; no suppressions added.Closes RAN-26.
Findings fixed
CodeIqApplicationisIndex,isEnrichlocalsisServeis read).Analyzerdead stores around inventorybuildFileInventory()+FileEntry/FileInventory/FileClassificationimports.EnrichCommand:154dead localflushed+recoveredEdgeslocals; replaced the inline comment with a WHY-comment explaining the flush + flushDeferred side effects still matter.EnrichCommand:425over-broad catchcatch (IOException | RuntimeException e).FileDiscovery:167swallowedIOExceptiondebugbefore returning.AnalysisCacheconstructor-escapefinalso the partially-constructed-instance escape path is no longer reachable.ReactComponentDetector:113allDetected/hookNamesGoStructuresDetectormethodPositionsTopologyServiceedgeKindsmap inblastRadiusNo behavioural changes: every removal is of values/objects that were written but never read, and the catch narrowing only widens what propagates.
Diff stats
Test plan
mvn spotbugs:checkpasses on this branch (BugInstance size is 0,BUILD SUCCESS)mvn test— not run locally; pre-existing infra issue tracked as RAN-27 blocks the frontend compile phase (TS 6.xbaseUrldeprecation). RAN-27 is in_review and unrelated to this change.spotbugs:check+dependency-checkbound tomvn verify) becomes actionable once this lands.Scope note
Original local-fix work was authored by BackendEngineer (Paperclip agent
b94a8dd0) mixed intofix/ran-9-max-file-bytes-capalongside RAN-9/10/12 WIP. This PR carves out the 8 RAN-26 files onto a clean branch offmainso the quality-gate restoration lands as a single, reversible, independently-reviewable change. Co-credited in the commit trailer.🤖 Generated with Claude Code via Paperclip