Skip to content

Solved sonar hotspots - #728

Merged
Matthbo merged 8 commits into
masterfrom
fix/solve-sonar-hotspots
Aug 26, 2026
Merged

Solved sonar hotspots#728
Matthbo merged 8 commits into
masterfrom
fix/solve-sonar-hotspots

Conversation

@stijnpotters1

@stijnpotters1 stijnpotters1 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Began with 43 hotspots
Image

Now:

@stijnpotters1 stijnpotters1 self-assigned this Aug 18, 2026
@stijnpotters1 stijnpotters1 linked an issue Aug 18, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Resolves Sonar findings across shared clients, data import, web security, and tests.

Changes:

  • Refactors exception handling, visibility, naming, and assertions.
  • Encapsulates Trivy report results.
  • Makes rate-limited paths configurable.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
insights-webapp/.../UserServiceIntegrationTest.java Uses specialized count assertions.
insights-webapp/.../UserResponseDTOTest.java Consolidates AssertJ assertions.
insights-webapp/.../GitHubOAuthAttributesTest.java Improves null and equality assertions.
insights-webapp/.../RateLimitServiceTest.java Uses specialized numeric assertions.
insights-webapp/.../RunCypressE2eTest.java Logs health-check failures.
insights-webapp/.../RateLimitInterceptorTest.java Supplies rate-limit configuration.
insights-webapp/.../TestSecurityConfig.java Adapts interceptor construction and security setup.
insights-webapp/.../SecurityConfigIntegrationTest.java Consolidates session assertions.
insights-webapp/src/main/resources/application.properties Defines protected and exempt paths.
insights-webapp/.../UserService.java Improves caught-exception handling.
insights-webapp/.../RateLimitProperties.java Adds rate-limit configuration properties.
insights-webapp/.../RateLimitInterceptor.java Uses configurable path matching.
insights-webapp/.../SecurityConfig.java Updates security-chain signature.
insights-data-import/.../GitHubWebhookSecurityIntegrationTest.java Strengthens webhook verification.
insights-data-import/.../GitHubWebhookControllerTest.java Removes duplicated coverage.
insights-data-import/.../VulnerabilityScanServiceTest.java Uses encapsulated report results.
insights-data-import/.../FileTreeDeleterTest.java Uses an unnamed resource variable.
insights-data-import/.../GitHubGraphQLClientTest.java Follows renamed client accessor.
insights-data-import/.../GitHubWebhookController.java Narrows the parsing exception.
insights-data-import/.../VulnerabilityScanService.java Uses report accessors.
insights-data-import/.../TrivyReport.java Encapsulates JSON-mapped results.
insights-data-import/.../ReleaseArtifactService.java Logs cleanup failures.
insights-data-import/.../SystemDataInitializer.java Narrows injection-step exceptions.
insights-common/.../GraphQLClientTest.java Follows renamed client accessor.
insights-common/.../ApiClientTest.java Uses a no-exception assertion.
insights-common/.../RestClient.java Restricts constructor visibility.
insights-common/.../GraphQLClient.java Refines naming, generics, and visibility.
insights-common/.../ApiClient.java Restricts constructor visibility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@stijnpotters1
stijnpotters1 marked this pull request as ready for review August 19, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 3 comments.

Suppressed comments (3)

insights-webapp/src/test/java/org/frankframework/insights/common/configuration/TestSecurityConfig.java:23

  • HttpSecurity.build() throws a checked Exception; without declaring or handling it, this test configuration does not compile. Restore the exception declaration.
    public SecurityFilterChain testSecurityFilterChain(HttpSecurity http) {

insights-webapp/src/main/java/org/frankframework/insights/common/configuration/SecurityConfig.java:49

  • HttpSecurity.build() declares a checked Exception, so removing it from this bean method leaves the .build() call at line 92 unhandled and prevents the webapp module from compiling. Restore the declaration (or catch and translate the exception).
    public SecurityFilterChain securityFilterChain(HttpSecurity http, SessionRegistry sessionRegistry) {

insights-webapp/src/main/java/org/frankframework/insights/common/ratelimit/RateLimitInterceptor.java:84

  • The configured protected paths are only evaluated after MVC selects this interceptor, but WebMvcConfiguration.java:19 still registers it solely for /api/auth/** and /api/business-value/**. Thus the newly configured /api/vulnerabilities path—and any other path added through this supposedly configurable list—never reaches this method and is not rate limited. Register the interceptor broadly and let isRateLimited filter requests, or derive registration patterns from these properties.
        return startsWithAny(requestURI, rateLimitProperties.getProtectedPaths())
                && !startsWithAny(requestURI, rateLimitProperties.getExemptPaths());

Comment thread docker/scripts/entrypoint.sh Outdated
Comment thread .dockerignore Outdated
Comment thread docker-compose.yaml
@Matthbo
Matthbo merged commit ee73f4d into master Aug 26, 2026
@Matthbo
Matthbo deleted the fix/solve-sonar-hotspots branch August 26, 2026 14:53
@sonarqubecloud

Copy link
Copy Markdown

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.

Fix all sonar hitspots on master

3 participants