Skip to content

Comments

QA: Add log level guards for logger.error statements#8

Open
melisaadakli wants to merge 3 commits intobezkoder:masterfrom
melisaadakli:qa/guard-logstatement-demo
Open

QA: Add log level guards for logger.error statements#8
melisaadakli wants to merge 3 commits intobezkoder:masterfrom
melisaadakli:qa/guard-logstatement-demo

Conversation

@melisaadakli
Copy link

@melisaadakli melisaadakli commented Feb 21, 2026

This PR addresses GuardLogStatement issues identified via static analysis (CodeFlow).

Logger.error calls are now protected with log-level checks to prevent unnecessary
message construction when error logging is disabled.
Converted MavenWrapperDownloader into a proper utility class
by adding a private constructor to prevent instantiation.

No functional or business logic changes were introduced.

Static Analysis Impact (CodeFlow)

  • GuardLogStatement issues: ✅ Fixed
  • CloseResource issues: ✅ Fixed (try-with-resources)
  • UseUtilityClass issue: ✅ Fixed (utility class pattern)

📉 CodeFlow results:

  • Errors reduced
code fixed observed on code flow code fixed maven wrapper downloader ss MavenWrapperDownloader code fixed ss

Known / Accepted Issues

  • SpringBootLoginExampleApplication is flagged by static analysis
    as UseUtilityClass, however this is an expected and acceptable
    pattern for Spring Boot entry-point classes.
  • No change was made intentionally to avoid altering framework conventions.

This demonstrates a QA-driven improvement focusing on code quality, resource safety, and logging best practices.

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