Skip to content

Exclude Gradle samples from SCA analysis to avoid FPs - #640

Merged
jonas-wielage-sonarsource merged 1 commit into
masterfrom
exclude-gradle-samples-from-sca
Apr 10, 2026
Merged

jonas-wielage-sonarsource merged 1 commit into
masterfrom
exclude-gradle-samples-from-sca

Conversation

@leveretka

Copy link
Copy Markdown
Contributor

No description provided.

@sonarqube-next

sonarqube-next Bot commented Oct 2, 2025

Copy link
Copy Markdown

@Godin Godin self-assigned this Jan 7, 2026
@Godin
Godin marked this pull request as draft January 7, 2026 09:32
@jonas-wielage-sonarsource
jonas-wielage-sonarsource force-pushed the exclude-gradle-samples-from-sca branch from 9bbdaa2 to 415ebef Compare April 10, 2026 12:38
@jonas-wielage-sonarsource
jonas-wielage-sonarsource marked this pull request as ready for review April 10, 2026 12:38
@jonas-wielage-sonarsource
jonas-wielage-sonarsource enabled auto-merge (squash) April 10, 2026 12:39
@sonar-review-alpha

sonar-review-alpha Bot commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds **/samples/** to SonarQube's Software Composition Analysis (SCA) exclusions in build.gradle.kts. This prevents the SCA scanner from analyzing Gradle sample/example code, which can generate false positives since samples are not part of the production codebase and often deliberately use simplified or outdated patterns for educational purposes.

What reviewers should know

Where to look: Single line change in build.gradle.kts (line 241) in the sonarqube configuration block, specifically the sonar.sca.exclusions property.

Context: The change aligns with the existing exclusion pattern for other non-production code (**/its/** for integration tests and **/kotlin-checks-test-sources/** for test sources). This is a common practice to focus SCA scanning on actual dependencies used in production.

What to verify: Confirm that **/samples/** correctly captures all sample/example directories in the Gradle project structure that should be excluded from SCA analysis.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@sonarqube-next

Copy link
Copy Markdown

@jonas-wielage-sonarsource
jonas-wielage-sonarsource merged commit 16928c5 into master Apr 10, 2026
7 of 8 checks passed
@jonas-wielage-sonarsource
jonas-wielage-sonarsource deleted the exclude-gradle-samples-from-sca branch April 10, 2026 12:57
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.

3 participants