SonarQube coverage is 0% for some classes

Version: classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
systemProp.sonar.host.url=https://cmo-sonar01.concurtech.net/
gradleVersion = '4.10.3’

Hi,
I initially had plugin with 2.5 and the classes included in the property “sonar.inclusions”, was shown up in the SonarQube.
Suddenly it started to show 0 coverage for all the classes, hence i updated the version to 2.7.1
Now i am getting coverage only for some classes. Others show 0% coverage.

I am getting this message when i run the sonarqube locally

Specifying module-relative paths at project level in the property ‘sonar.inclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/HelperMethods.java’, update this property so that patterns refer to project-relative paths.

Specifying module-relative paths at project level in the property ‘sonar.exclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/StrategyFactory.java’, update this property so that patterns refer to project-relative paths.

Specifying module-relative paths at project level in the property ‘sonar.cpd.exclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/First.java’, update this property so that patterns refer to project-relative paths.

Cobertura report not found at /Users/Projects/TA/allowanceCalculation/target/site/cobertura/coverage.xml

I am unaware of how to fix this issue. Can someone kindly help me with this.

Thanks in advance.

Hi,

Welcome to the community!

What’s your version of SonarQube, and did you upgrade recently? If so, from what version?

 
Ann

Hi @ganncamp Good Day,
The current version of Sonar Qube used by the project is:

  • Community Edition Version 7.9.1 (build 27448)
    Inside the project we have not defined any sonar version and
    We don’t usually do any upgrades of the sonarQube as it is owned centrally.

The dependency maintained is only classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"

Kindly help me with your views. Thanks in advance.

Hi,

It would be helpful to post your code-formatted (``` on the line before and on the line after) analysis logs. Please make sure the log includes your analysis command.

 
Ann

Hi @ganncamp the following is the code and analysis. Sorry i was unaware of the formatting being new to this forum. Kindly let me know if any information is needed. Thanks

In build.gradle:
dependency {
classpath org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1
}

sonarqube {
properties {
       property "sonar.sources", "src/main/java"
       property "sonar.tests", "src/test/java"
       property "sonar.java.binaries", "${project.buildDir}/classes/main/"
       property "sonar.java.test.binaries", "${project.buildDir}/classes/test/"
       property "sonar.junit.reportsPath", "${project.buildDir}/test-results/"
       property "sonar.jacoco.reportPaths", "${project.buildDir}/jacoco/test.exec"
       property "sonar.projectName", theName+"-XXX"
       property "sonar.projectKey", "ps:" + theName+"-XXX"
       property "sonar.inclusions",
               "allowanceCalculation/src/main/java/com/**/*, " 
}

On running ./gradlew sonarQube - i am receiving the following message -

the classes under allowanceCalculation package are not covered 

Specifying module-relative paths at project level in the property ‘sonar.inclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/HelperMethods.java’, update this property so that patterns refer to project-relative paths.

Specifying module-relative paths at project level in the property ‘sonar.exclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/StrategyFactory.java’, update this property so that patterns refer to project-relative paths.

Specifying module-relative paths at project level in the property ‘sonar.cpd.exclusions’ is deprecated. To continue matching files like ‘allowanceCalculation/src/main/java/com/First.java’, update this property so that patterns refer to project-relative paths.

Cobertura report not found at /Users/Projects/TA/allowanceCalculation/target/site/cobertura/coverage.xml

Hi Team,

Can anyone guide me on this?
Thanks