question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sonarqube ignoring files / folders not working

See original GitHub issue

Describe the bug I’m using jenkins to scan on sonarqube, and I’ve got the code coverage working using your tool, but I can’t for the life of me work out how to exclude a file / folder successfully.

I’m using dotnet-reportgenerator-globaltool as we use .Net Core 3.1

To Reproduce This is my main command: reportgenerator "-reports:*/TestResults/*/coverage.cobertura.xml" "-targetdir:sonarqubecoverage" "-reporttypes:SonarQube"

I’ve tried the following with no success:

-assemblyfilters:-*DevonMicroservice\\.Application\\.Configuration* -assemblyfilters:-*DevonMicroservice.Application.Configuration* -assemblyfilters:-DevonMicroservice.Application.Configuration* -filefilters:-*DependencyInjectionConfiguration.cs -filefilters:-*ConfigReader.cs

I have also tried wrapping them in quotes which hasn’t worked either

I have files such as: DevonMicroservice.Application.Configuration/ConfigurationManager.cs

I’d like to ignore any files underneath the folder: “DevonMicroservice.Application.Configuration” and others, but if I can get one working it should be rather simple (I hope) to fix

Any help would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nholdsworth94commented, Dec 15, 2021

Yes I experience the same locally Must be a sonarqube issue Appreciate your quick and detailed support massively

0reactions
nholdsworth94commented, Dec 15, 2021

Thanks, in the end I have gone for the approach of “include” rather than “exclude” I have got the coverage up, but I’m still experiencing sonarqube behaving oddly, but I don’t think this is your tool, as that is working exactly as expected locally. Thank you again 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

sonar runner - SonarQube Exclude a directory
Easiest way is to go to the server URL after starting the server(localhost:8080) then login as admin,Go to settings>Exclusions> Source File ...
Read more >
Files and subfolders exclusions - SonarQube
Just small clarification. If I want exclude files and sub folders within a package, which one of below is right **/{package-folder}/** ...
Read more >
Narrowing the Focus | SonarQube Docs
Ignore Code Coverage. You can prevent some files from being taken into account for code coverage by unit tests. To do so, go...
Read more >
Exclude Folders from SonarQube analysis
Just go to the administration page of the project and in the Analysis Scope you find the Source File Exclusions section that allows...
Read more >
Analysis Scope - SonarCloud Docs
By default, sonar.sources is set to the current working directory (ie: the path . ) ... General Settings > Analysis Scope > Issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found