When using SonarQube Server (enterprise v10.8) and the Azure Devops Scanner CLI (tool v7.1.1 - CLI v6.2.1.4610) the code that is pulled into the coverage metrics (and gated) includes files outside of the files reported in the provided coverage report (lcov.info or SonarQube.xml).
When using tools like vitest (v8) that have out-of-the-box defaults for files that are excluded from the coverage report, it is causing discrepancies between the coverage report (as shown directly in Azure Devops) and what SonarQube is reporting.
Is there any way to configure SonarQube to use the coverage report for the “Lines to cover”?
The only other workaround I’ve found is to copy the default settings from these tools into the exclusions setting within SonarQube, but this is cumbersome and prone to issues, especially if individual repositories override these defaults.