I’m running a gradle build for Java code and using Jacoco for generating CodeCoverage.
Only ‘some’ new/modified code shows after a build/analysis:
- under Measures–Size–New lines (in my current analysis it reported 3 new lines and if I select it, it is associated with 1 source file, however 6 source files were modified in this build) However if I look at “Lines of Code”, the value changed by 9 between this analysis and the previous one.
- under Measures–Maintainability-On new code–Code Smells it did report 2 new issues and they are associated with 2 source files
- under Measures–Coverage–On new code all the metrics are at 0. However noted above, there is modified code, so if the ‘new’ metrics are 0, why didn’t my Quality Gate changed to Failed since the Gate’s Condition for “Coverage on New Code” is set to Error if coverage is < 75 ??
In my previous build, LOC report 100 lines of code changed and if I looked at the source file in SonarQube for some of those lines, it saw the new lines, and they were highlighted that there was no Code Coverage, but again my Quality Gate didn’t get flagged.
Can you please explain why I see these discrepancies when looking at the number of ‘new’ files and ‘new’ LOC and also why the Quality Gate is NOT being triggered?