SonarQube says "Not covered by tests" for most of lines
16,326
SonarQube reads code coverage reports and marks which lines have been tested (covered by tests). not covered
means that those lines are not included in the code coverage reports. There are two options, your tests:
- don't check the code from the screen
- check the code from the screen, but the code coverage report:
- didn't include data of these tests
- has not been generated and uploaded to the server
Documentation about SonarQube Test Coverage & Execution.
Author by
Gihoon Kang
Updated on June 04, 2022Comments
-
Gihoon Kang almost 2 years
I'm evaluating SonarQube Developer for our development team, and facing most of the lines are tagged as "Not covered by tests".
I suppose "not covered" means "not checked or not tested". Am I guess right?
Please let me know the exact meaning of "not covered" and why this happens.
Below are the background info. of this evaluation.
- SonarQube 7.3 (BuildWrapper and SonarScanner for Windows)
- C/C++ Project using Qt 5.9
Screenshot of SonarQube Console
-
SSD over 3 yearsyou mentioned - those lines are not included in the code coverage reports. why SonarQube did that and when SonarQube will cover these lines?. I am also facing same issue. what needs to be done to resolve?
-
agabrys over 3 yearsSonarQube only displays coverage results produced by other tools. You have to use a coverage tool (like JaCoCo for Java), execute it and next performs SonarScanner analysis. If the lines are covered by tests, they will be marked as covered in SonarQube UI.