Exclusions not working


(Greg Pakes) #1

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:

image

Yet, sonar still analyses the file:

How can I get the exclusion to work correctly?


(Alexandre Frigout) #2

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.


(Greg Pakes) #3

Hi,

Sure - Can I send it privately?

thanks,

Greg


(Greg Pakes) #4

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


(Alexandre Frigout) #5

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.


(Greg Pakes) #7

Hi,

The logs can be downloaded here.

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

thanks,

Greg


(Alexandre Frigout) #8

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.


(Greg Pakes) #9

Thank you very much.