22

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"
  },
NoobEditor
  • 15,563
  • 19
  • 81
  • 112
Sohail Si
  • 2,750
  • 2
  • 22
  • 36

1 Answers1

38

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.

Pierre-Yves
  • 1,476
  • 10
  • 15