fix: resolve top 5 SonarQube issues (weekly sweep) - #1075
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: replace wildcard ResponseEntity<?> return types with ResponseEntity<Map<String, Object>> in ArticleApi (x2) and CommentsApi - S1948: mark non-serializable Errors field transient in InvalidRequestException - S5869: remove duplicate characters / nested class from the toSlug regex in Article - spotlessApply on DefaultJwtServiceTest (pre-existing format violation) 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:
|
|
|
||
| public static String toSlug(String title) { | ||
| return title.toLowerCase().replaceAll("[\\&|[\\uFE30-\\uFFA0]|\\’|\\”|\\s\\?\\,\\.]+", "-"); | ||
| return title.toLowerCase().replaceAll("[&|\\uFE30-\\uFFA0’”\\s?,.]+", "-"); |
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. The only SonarQube project visible to the MCP server is
choikh0423_demo-spring-boot-test-coverage(sameio.springcodebase; no project keyed onspring-boot-realworld-example-app), so issues were pulled from it. 265 open issues; ranked by severity → type → effort → recency. The 4 CRITICAL issues are all code smells; the 5th is the highest-ranked MAJOR bug (S5869 beats S2885 on effort).AZ1u3HCaEnUkF3fpjVtjArticleApi.articlereturns generic wildcardResponseEntity<?>ResponseEntity<Map<String, Object>>(the actual type produced byarticleResponse)AZ1u3HCaEnUkF3fpjVtkArticleApi.updateArticlereturnsResponseEntity<?>AZ1u3HBkEnUkF3fpjVtQCommentsApi.createCommentreturnsResponseEntity<?>ResponseEntity<Map<String, Object>>(type ofcommentResponse)AZ1u3HBdEnUkF3fpjVtNInvalidRequestException(aSerializableRuntimeException) holds a non-serializableErrorsfieldprivate final transient Errors errors;— the field is only consumed in-process by the exception handler, so it's excluded from serialization rather than forcingErrorsto be serializableAZ1u3HAWEnUkF3fpjVs_Article.toSlugregex `[&Also ran
spotlessApply, which reformatted one line inDefaultJwtServiceTest— a pre-existing violation onmasterthat madespotlessCheckfail.Verified locally:
./gradlew spotlessCheckand./gradlew test(68 tests, 0 failures). Note: this repo currently has no GitHub Actions workflows, so there is no CI to wait on.Link to Devin session: https://app.devin.ai/sessions/ffd4298467dc4a7cb62149ede913a337
Open in Devin Desktop: https://app.devin.ai/desktop/session/ffd4298467dc4a7cb62149ede913a337?variant=devin
Requested by: @choikh0423