I’m using the Gradle sonarqube version 2.7 plugin. Ever since I upgraded to 2.7 (I was using 2.6.2 before that) I noticed the code coverage has dropped despite the code remaining the same. In particular, it said some of my code was not covered when in fact there are tests for that code.
(If it matters, I was running SonarQube 7.0 - I just upgraded to 7.7 but the behaviour remains).
In addition, I started getting errors during the running of the plugin saying
the class ‘X’ could not be matched to its original source file. It might be a dynamically generated class
All of the classes it mentions are actually part of the projects being analysed, so the source files are actually there.
This is a multi-module Gradle project. Each sub-project is in a “standard” layout (i.e src/main/java for the main code, src/main/test for the test code).
In the top-level build.gradle file, I have the properties “sonar.cpd.exclusions” and “sonar.exclusions” defined. Apart from that, there’s no other special configuration.
Any ideas on why my code coverage has dropped suddenly and no longer picking up some tests running over some code? Is it related to the “could not be matched” problem? Is there anything else I need to look at?
Thanks,
Ian