- which versions are you using: SonarQube Developer Edition 9.9.0.65466
- how is SonarQube deployed: Docker
- what are you trying to achieve: get accurate coverage metrics that skip comments nested in the function body
- what have you tried so far to achieve this: nothing, as those comments cannot be excluded or moved on the top of the function
Description of a problem:
If there are comments nested in the function body, above the uncovered lines, those will be counted as uncovered lines
, so eventually, those are considered by Sonar as uncovered code that affects the final coverage
metric. However, as soon as the real code line is covered, coverage metrics are accurately provided, ignoring comments during counting (or considering them as covered). Do I understand correctly, that If I have 98 lines of nested comments out of 100 (2 lines of actual code), I will get 2% of coverage?