Since we updated to SonarQube 6.2 it seems code coverage plugin got merged in the core. It shows red flags everywhere and I can’t find how to turn it off, we do not use code coverage.
You don't specify what language(s) you're analyzing. I'll assume Java and/or JavaScript. Starting from 6.2, SonarQube supports "force coverage to 0", which marks as uncovered executable lines in files that don't show up in any coverage reports. (That's assuming the underlying code analyzers support the feature, and Java and JavaScript already do.) The purpose is to have a more accurate picture of what's missing when you actually are using unit tests. Without this feature, it's impossible to tell whether a file that's omitted from coverage reports is missing because it has no executable code or because there are no tests on it - even when there should be.
Since you're not using unit tests (really?) you can exclude all the source files in your project from coverage calculations via the UI: Administration > Analysis Scope > Coverage Exclusions. A pattern value of **/*.*
ought to do it for you.
sonnar-scanner
cmd? e.g. sonnar-scanner -Dforce.zero.coverage=true
or sth like that? –
Hymenopterous Code coverage feature is in SonarQube misleading. To turn this off:
- Under Quality gates create new or copy existing profile.
- There delete Coverage metric
SonarQube Version: 9.2
© 2022 - 2024 — McMap. All rights reserved.