Skip to content

Fix/sonar cleanup - #12

Merged
RuslanLomaka merged 7 commits into
masterfrom
fix/sonar-cleanup
Sep 1, 2026
Merged

Fix/sonar cleanup#12
RuslanLomaka merged 7 commits into
masterfrom
fix/sonar-cleanup

Conversation

@RuslanLomaka

@RuslanLomaka RuslanLomaka commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove unneeded throws Exception from SecurityConfig/DevSecurityConfig (S112) — HttpSecurity.build() no longer declares a checked exception in this project's Spring Security version
  • Extract duplicated "docker" literal to a constant in DockerExecutable (S1192)
  • Replace Problem's 11-argument telescoping constructor with a Builder (S107), update the three problem definitions to use it
  • Replace System.err with SLF4J logging in JavaRunnerService and SandboxReaperService (S106)
  • Add missing Javadoc across the problem package (Checkstyle MissingJavadocType/Method)

Test plan

  • ./mvnw clean verify passes locally (0 Checkstyle violations, all tests green)
  • CI passes on this PR

HttpSecurity.build() no longer declares a checked exception in this
project's pinned Spring Security version, so the declaration was dead
weight flagged by Sonar (S112).
Fixes Sonar S1192 (string literal duplicated 3 times) in
DockerExecutable.
The 11-argument constructor (S107) was fragile: six adjacent String
parameters made it easy to swap two arguments with no compiler error.
Problem.Builder names each field at the call site instead, and the
three problem definitions are updated to use it.

Also adds missing class/method Javadoc to the three problem classes.
Fixes Sonar S106 (use a logger, not System.err/out) across
JavaRunnerService and SandboxReaperService. Abnormal-but-handled exits
use log.warn; genuine caught exceptions use log.error.
Closes out the remaining Checkstyle MissingJavadocType/Method
violations flagged by CI.
DevSecurityConfig is @Profile("dev")-only and permits every request
with no authentication, so there's no authenticated session for a
forged cross-site request to exploit. Documented and suppressed
(S4502) rather than left flagged, since it was blocking the Quality
Gate on new-code security rating.
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@RuslanLomaka
RuslanLomaka merged commit 6e51b46 into master Sep 1, 2026
4 checks passed
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