Skip to content

fix: resolve top 5 SonarQube issues (weekly sweep) - #1075

Open
choikh0423 wants to merge 1 commit into
masterfrom
devin/1788814919-sonarqube-weekly-sweep
Open

choikh0423 wants to merge 1 commit into
masterfrom
devin/1788814919-sonarqube-weekly-sweep

Conversation

@choikh0423

@choikh0423 choikh0423 commented Sep 7, 2026

Copy link
Copy Markdown

Summary

Weekly SonarQube sweep. The only SonarQube project visible to the MCP server is choikh0423_demo-spring-boot-test-coverage (same io.spring codebase; no project keyed on spring-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).

# Key Severity / Type Issue Fix
1 AZ1u3HCaEnUkF3fpjVtj CRITICAL / CODE_SMELL (java:S1452) ArticleApi.article returns generic wildcard ResponseEntity<?> Return ResponseEntity<Map<String, Object>> (the actual type produced by articleResponse)
2 AZ1u3HCaEnUkF3fpjVtk CRITICAL / CODE_SMELL (java:S1452) ArticleApi.updateArticle returns ResponseEntity<?> Same as above
3 AZ1u3HBkEnUkF3fpjVtQ CRITICAL / CODE_SMELL (java:S1452) CommentsApi.createComment returns ResponseEntity<?> Return ResponseEntity<Map<String, Object>> (type of commentResponse)
4 AZ1u3HBdEnUkF3fpjVtN CRITICAL / CODE_SMELL (java:S1948) InvalidRequestException (a Serializable RuntimeException) holds a non-serializable Errors field private final transient Errors errors; — the field is only consumed in-process by the exception handler, so it's excluded from serialization rather than forcing Errors to be serializable
5 AZ1u3HAWEnUkF3fpjVs_ MAJOR / BUG (java:S5869) Article.toSlug regex `[& [\uFE30-\uFFA0]

Also ran spotlessApply, which reformatted one line in DefaultJwtServiceTest — a pre-existing violation on master that made spotlessCheck fail.

Verified locally: ./gradlew spotlessCheck and ./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


Devin Review

- 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-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review


public static String toSlug(String title) {
return title.toLowerCase().replaceAll("[\\&|[\\uFE30-\\uFFA0]|\\’|\\”|\\s\\?\\,\\.]+", "-");
return title.toLowerCase().replaceAll("[&|\\uFE30-\\uFFA0’”\\s?,.]+", "-");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Slug character set remains unchanged

The flattened class preserves every previous member, including literal pipes and U+FE30–U+FFA0. Existing slug output remains unchanged.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant