Exclusions not working

Hi,

I am trying to exclude a huge XML file. I am using the exclusions in the SonarCloud UI, but the exclusion is not working. I have ensured the exclusion is case sensitive, but it still doesn’t work.

The exclusion is as follows:

Yet, sonar still analyses the file:

How can I get the exclusion to work correctly?

Hi Greg,

Can you please share the log of the analysis in debug mode so we can see what is indexing this file ?

Greetings,
Alex.

Hi,

Sure - Can I send it privately?

thanks,

Greg

The log is 20MB. I can’t send a zip as it’s not allowed. What do I do?

Hi Greg,

I actually have no endpoint to give you to post this zip.
Do you have a place where you could put it and give me a download link ?

Greetings,
Alex.

Hi,

The logs can be downloaded here.

https://1drv.ms/u/s!AtMMegtv-j6JicgxZRsGqOh4nuGNhg

thanks,

Greg

Hello Greg,

The exclusion mechanism taking relative paths into account, you cannot set your exclusion pattern as **/iSAMS.Data.SqlClient/Procedures.xml.
By doing this, when the analyser will start analysing the iSAMS.Data.SqlClient withe the below basedir:

INFO: Base dir: C:\vsts-agent\agent\_work\2\s\iSAMS.Data.SqlClient

It will search for a file in the iSAMS.Data.SqlClient\iSAMS.Data.SqlClient directory.
Instead, you can put the following pattern:
**/Procedures.xml and you should get the exclusion working.

Please note that the same applies on your other exclusion patterns, I think particularly about the SqlNetTiersProviders.cs and the DataRepository.cs files.

Greetings,
Alex.

2 Likes

Thank you very much.

So given your answer, how do you exclude all files in a specific folder?

I too am facing the same issue.
Following.