New Sonarqube implementation here, and we’re struggling a bit with the inconsistencies in the coverage reporting. I’ve checked through everything I can find on Google, GitHub, and in the forums here and a few of the suggested solutions that worked for others just aren’t working for me.
I’ve got a Typescript project with a few source directories as specified in the
sonar.Sources property. I am also specifying the coverage locations with the
If I go view the HTML coverage report that’s generated by NYC I have 100% coverage. When running the SonarScanner we end up in the 96% ish range.
Running the SonarScanner with debug logs, I do see why this is happening:
10:48:20.566 DEBUG: Problem during processing LCOV report: can't save DA data for line 8608 of coverage report file (java.lang.IllegalArgumentException: Line with number 4 doesn't belong to file index.ts).
Typical fixes suggested here are:
sourceMapsare on in the tsconfig.json, which they are
- Ensure the
sonar.sourcesare set correctly, which they are (if they aren’t typically you get a 0% coverage in Sonar)
- Ensure the
None of these fixes seem to be getting me any closer, or helping me get through this LCOV report processing issue.
I’m at a bit of a loss at this point and hoping someone has another magic bullet config change that worked for them.
sonar-project.properties file (genericized a bit for security) as well:
Here’s version info for reference:
INFO: Scanner configuration file: C:\sonarscanner\bin\..\conf\sonar-scanner.properties INFO: Project root configuration file: C:\github\<my-project>\sonar-project.properties 11:03:13.358 INFO: SonarScanner 184.108.40.2062 11:03:13.364 INFO: Java 11.0.3 AdoptOpenJDK (64-bit) 11:03:13.365 INFO: Windows 10 10.0 amd64
SonarQube 220.127.116.11397 (Community Edition)
SonarJS 6.2 (build 12043)
SonarTS 2.1 (build 4359)
Typescript 3.8.3 (I do get the not officially supported message, I have the same problem with Typescript 3.7.5 which is supported)