fix: resolve top 5 SonarQube issues (weekly sweep) - #1081
Open
choikh0423 wants to merge 1 commit into
Open
choikh0423 wants to merge 1 commit into
choikh0423 wants to merge 1 commit into
Conversation
- S1452: concrete ResponseEntity<Map<String, Object>> return types in ArticleApi (x2) and CommentsApi - S1948: make non-serializable Errors field transient in InvalidRequestException - S2885: replace static shared Calendar in DateTimeHandler with a per-call instance Co-Authored-By: Kyu Choi <kyuhwanchoi0423@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Weekly SonarQube sweep. SonarQube project key:
choikh0423_demo-spring-boot-test-coverage(the only project in the org; its file paths match this repo). 265 open issues; ranked by severity → type → effort → recency. The top 5 are the 4 CRITICAL issues plus the only MAJOR-severity BUG.AZ1u3HBdEnUkF3fpjVtNInvalidRequestException.java:7errors(org.springframework.validation.Errors) in aSerializableclass is neither transient nor serializableprivate final transient Errors errors;AZ1u3HCaEnUkF3fpjVtjArticleApi.java:36ResponseEntity<?>in return type ofarticle()ResponseEntity<Map<String, Object>>(matches whatarticleResponse()returns)AZ1u3HCaEnUkF3fpjVtkArticleApi.java:45updateArticle()ResponseEntity<Map<String, Object>>AZ1u3HBkEnUkF3fpjVtQCommentsApi.java:41createComment()ResponseEntity<Map<String, Object>>(matchescommentResponse())AZ1u3HAmEnUkF3fpjVtCDateTimeHandler.java:18static final Calendar UTC_CALENDARshared across threads;Calendaris not thread-safe and JDBCgetTimestamp/setTimestamp(…, Calendar)mutate itTimeZoneas a static, and hand each JDBC call a freshCalendar.getInstance(UTC)viautcCalendar(). (An instance field would still be shared because MyBatis holds oneTypeHandlerinstance.)Note: the SonarQube MCP response does not expose per-issue type/effort, so type was taken from
show_ruleand effort ordering was applied at the rule level.Verification
./gradlew test: 68 tests, 0 failures../gradlew spotlessCheck: the 4 changed files are clean. The only violation reported is preexisting onmaster(DefaultJwtServiceTest.java:16, line too long) and is left untouched here.-Dorg.gradle.jvmargs="--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED …"(google-java-format 1.x); the repo has no build/test CI job, so this was verified locally.Link to Devin session: https://app.devin.ai/sessions/bff8528aa3294c9ba9880b0811709a49
Open in Devin Desktop: https://app.devin.ai/desktop/session/bff8528aa3294c9ba9880b0811709a49?variant=devin
Requested by: @choikh0423