I have a sonar-project.properties file, which specifies how sonar-runner inspects the the folder structure, which files to inspect, which files to ignore etc.
I cannot successfully determine however how to exclude multiple paths successfully.
Here is the sonar-project.properties file:
sonar.projectKey=C3S-web sonar.projectName=C3S-sonar-web sonar.projectVersion=0.0.1 sonar.sources=. sonar.tests=test sonar.language=js sonar.profile=Sonar way sonar.exclusions=test/*, node_modules/* sonar.dynamicAnalysis=reuseReports sonar.javascript.jstest.reportsPath=coverage sonar.javascript.lcov.reportPath=coverage/lcov-report
the line I am having trouble with is:
sonar.exclusions
listing multiple paths does not work, with or without a comma, or in quotes either.
Choosing Files To specify which files are are and are not included in an analysis go to Administration > General Settings > Analysis Scope > Files. Use exclusion to analyze everything but the specified files: sonar. exclusions - to exclude source code files.
In Java, we can exclude Sonar checks using the built-in @SuppressWarnings annotation. This works exactly the same way as suppressing compiler warnings. All we have to do is specify the rule identifier, in this case java:S106.
You have to use the double asterisk pattern to recursively exclude all sub-folders and files:
sonar.exclusions=test/**, node_modules/**
A single asterisk matches only the files on that specific folder (no recursion).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With