.sonarcloud.properties exclusions not working for automatic analysis

Hello,

I am working with a team using SonarCloud to scan a React TypeScript repo that contains many integrations and pieces of external code. I am trying to limit scanning to directories our team is developing that contain actual logic using a .sonarcloud.properties file. The file loads exclusions with this format:

sonar.exclusions=.github/**/*

After deploying the change to GitHub on the main branch, SonarCloud still shows as if it’s trying to scan all project directories (over 150,000 lines of code). Loading scan context in background tasks shows that exclusions have loaded properly:

sonar.exclusions=.github/**/*, ... (all exclusions are present here)

The main branch summary shows only 14,000 lines of code. This is the correct number if all the exclusions are loaded properly. Is it possible the exclusions are somehow partially loaded?

Has anybody seen a similar issue? I’d appreciate any tips on how to resolve. Thanks!

1 Like

I am also facing the issue with sonar.java.binaries and struggling for past 2 weeks. I tried adding the target/classess nor with **/*.jar. can some one help here. thanks.

Hi all,

Welcome to the community!

@Tamilselvi_Mano could you create a new thread, please? While these issues are similar on the surface, the investigations are likely to go in very different directions.

@Rebecca_Morris can you expand on this, please?

What makes you think this is the case?

Also,

You shouldn’t need to do this in the first place. Can you share your full (redacted, as necessary) analysis configuration? Because dot directories, and especially SCM metadata should be ignored automatically.

 
Thx,
Ann

Thanks Ann,

I think I’ve found an explanation based on changes we’ve made to parameters. I can work internally on the scan.

Rebecca

1 Like