What is the difference between coverage_exclusions
vs exclusions
in sonar? example:
"sonar": {
"exclusions": "gulpfile.js, ...",
"coverage_exclusions": "gulpfile.js, ..., server/models/*.js",
"quality_gate": "...",
"server_id": "SONAR-main"
},
sonar.exclusions and sonar.coverage.exclusions are standard property names for SonarQube. I don't know how the tool you use feeds these properties to the analysis based on your configuration file. Thanks for contributing an answer to Stack Overflow!
Source File Exclusions ( sonar.exclusions) - to exclude source code files. Test File Exclusions ( sonar.test.exclusions) - to exclude test files. The vast majority of needs are met simply by setting sonar.sources carefully. Most other needs are met with the addition of a few simple exclusions.
Set the sonar.sources property to limit the scope of the analysis to certain directories. For most languages, you can restrict the scope of analysis to files matching a set of extensions. Go to Project Settings > General Settings > [Language] to set the File suffixes property.
This behavior can be disabled. See sonar.scm.exclusions.disabled in the Analysis Parameters page for details. Set the sonar.sources property to limit the scope of the analysis to certain directories. For most languages, you can restrict the scope of analysis to files matching a set of extensions.
sonar.coverage.exclusions
excludes some files from the test coverage metrics but those files are still analyzed: other metrics, duplications, coding rules...
sonar.exclusions
completely excludes some files from the analysis: those files don't appear at all in SonarQube.
See https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/
sonar.exclusions
and sonar.coverage.exclusions
are standard property names for SonarQube. I don't know how the tool you use feeds these properties to the analysis based on your configuration file.
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