Skip to content

chore: fix Sonar quality issues (batch 1) - #2109

Merged
lbroudoux merged 2 commits into
microcks:masterfrom
gyanranjanpanda:fix/issue-2058-sonar-quality-batch1
May 11, 2026
Merged

lbroudoux merged 2 commits into
microcks:masterfrom
gyanranjanpanda:fix/issue-2058-sonar-quality-batch1

Conversation

@gyanranjanpanda

@gyanranjanpanda gyanranjanpanda commented May 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR addresses a focused set of SonarCloud code smells as part of #2058. All changes are mechanical, zero-behavioral-impact transformations.

Changes (9 files)

Rule Description Files
S1186 Add comments to intentionally empty methods CorsFilter, StaticResourcesFilter, GenericResourceServiceDTO, WebSocketClient
S128 Fix switch fall-through (explicit return) AvroUtil
S5361 Replace replaceAll() with replace() (no regex needed) PostmanUtil
S1192 Use existing constant instead of duplicate literal OpenAICopilot
— Replace System.err.println with SLF4J logger (full stack trace) TraceUtil
— Fix Spotless formatting violation ExamplesExporter

Risk Assessment

Low risk — All changes are comment additions, API substitutions (replaceAll → replace, System.err → log.error), constant reuse, explicit control flow that was already implicit, and a CI-enforced formatting fix.

Note

Spotless verification passed locally via commit hook, but full tests could not be run locally because the project targets Java 25 and only Java 17 is available.

Refs #2058

@gyanranjanpanda

Copy link
Copy Markdown
Contributor Author

Thanks for the context. I realized this PR is for #2058, not #2110. I updated the wording from "Closes" to "Refs" because #2058 is an umbrella issue.

I also removed the following changes that overlap with existing PRs:

The remaining 8-file diff is now focused on non-duplicated code smells: empty method comments (S1186), switch fall-through fix (S128), replaceAll → replace (S5361), duplicate literal constant (S1192), and System.err → SLF4J logger.

@gyanranjanpanda
gyanranjanpanda force-pushed the fix/issue-2058-sonar-quality-batch1 branch from 034324d to 3c7eafa Compare May 9, 2026 19:32
Address multiple SonarCloud code smells:

- S1186: Add explanatory comments to intentionally empty methods
  (CorsFilter, StaticResourcesFilter, GenericResourceServiceDTO,
   WebSocketClient)
- S128: Fix switch fall-through in AvroUtil.validate()
- S5361: Replace replaceAll() with replace() in PostmanUtil
  (no regex needed for literal replacement)
- S1192: Use MODEL_KEY_CONFIG constant instead of duplicated
  'model' literal in OpenAICopilot
- Replace System.err.println with SLF4J logger in TraceUtil

Refs microcks#2058

Signed-off-by: Gyan Ranjan Panda <[email protected]>
@gyanranjanpanda
gyanranjanpanda force-pushed the fix/issue-2058-sonar-quality-batch1 branch from 3c7eafa to 6673ee7 Compare May 9, 2026 19:45
Signed-off-by: Gyan Ranjan Panda <[email protected]>
@gyanranjanpanda

Copy link
Copy Markdown
Contributor Author

could @lbroudoux review this waiting for your feed back

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch! Thanks!

@lbroudoux lbroudoux added kind/task java Pull requests that update Java code labels May 11, 2026
@lbroudoux lbroudoux added this to the 1.15.0 milestone May 11, 2026
@lbroudoux
lbroudoux merged commit 8df9ba1 into microcks:master May 11, 2026
12 checks passed
@gyanranjanpanda
gyanranjanpanda deleted the fix/issue-2058-sonar-quality-batch1 branch May 11, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code kind/task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants