fix: resolve top 5 SonarQube issues (weekly sweep)#520
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
fix: resolve top 5 SonarQube issues (weekly sweep)#520devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
- S1948: Make 'errors' field transient in InvalidRequestException (CRITICAL) - S1452: Replace wildcard type ResponseEntity<?> with ResponseEntity<Map<String, Object>> in ArticleApi.article() (CRITICAL) - S1452: Replace wildcard type ResponseEntity<?> with ResponseEntity<Map<String, Object>> in ArticleApi.updateArticle() (CRITICAL) - S1452: Replace wildcard type ResponseEntity<?> with ResponseEntity<Map<String, Object>> in CommentsApi.createComment() (CRITICAL) - S1118: Add private constructor and make Util class final (MAJOR) Co-Authored-By: Kyu Choi <kyuhwanchoi0423@gmail.com>
Author
🤖 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
Addresses the top 5 open SonarQube issues for
choikh0423_demo-spring-boot-test-coverage(SonarCloud), ranked by severity → type → effort:AZ1u3HBdEnUkF3fpjVtNInvalidRequestException.javaerrorsfield astransientso the non-serializableErrorsfield doesn't violate theSerializablecontractAZ1u3HCaEnUkF3fpjVtjArticleApi.java:36ResponseEntity<?>→ResponseEntity<Map<String, Object>>AZ1u3HCaEnUkF3fpjVtkArticleApi.java:45ResponseEntity<?>→ResponseEntity<Map<String, Object>>AZ1u3HBkEnUkF3fpjVtQCommentsApi.java:41ResponseEntity<?>→ResponseEntity<Map<String, Object>>AZ1u3HAuEnUkF3fpjVtDUtil.java:3finalAll existing tests pass (
./gradlew test). Note:./gradlew spotlessCheckfails onmasteras well (pre-existing google-java-format issue).Review & Testing Checklist for Human
transientonInvalidRequestException.errors: Verify no code path serializes/deserializes this exception (e.g., across microservice boundaries, session replication). If it is ever deserialized,errorswill benull. This is the only behavioral change in the PR.ResponseEntity<Map<String, Object>>doesn't break Swagger/OpenAPI doc generation if the project uses it. The actual return values already match this type.Utilmadefinal: Confirm no subclass ofUtilexists (tests pass, so very likely safe).Recommended test plan: Run the full test suite and verify the API endpoints (
GET /articles/{slug},PUT /articles/{slug},POST /articles/{slug}/comments) return correct responses.Notes
ResponseEntity<?>/ rawResponseEntityusages across these files were fixed—these were the ones flagged as top-5 priority by SonarQube. Remaining raw types (e.g.,deleteArticle,getComments) are lower-priority and can be addressed in a future sweep.Link to Devin session: https://app.devin.ai/sessions/418f65d0566a4814a4c746a5070ec671
Requested by: @choikh0423