Clover Report is not getting reflected in the SOnarQube (through "Sonar-Scanner" - command line)

1,894 views
Skip to first unread message

Daniel Mascarenhas

unread,
Sep 27, 2016, 6:32:30 AM9/27/16
to SonarQube
Hello All,

I have this below Clover report generated in xml format.(see the Clover xml report snippet below)
This report has, clover code coverage details. This also has unit test details included(mostly numbers).
I need to import this report onto SonarQube. I have installed clover plugin.
Now, I am trying to run Sonar analysis, by passing '-Dsonar.clover.reportPath' property set to this xml report path.
However I am not able to see the clover coder coverage details in the sonarQube.
PFA Clover xml report snippet, & Sonar Qube Execution console Logs

I have Below Questions:
1. Do I need to pass, JUNIT test reports (xml) as well, for clover details to be seen? As I am only passing clover xml report details? I am using simple "SonarQube Scanner Command Line"
2. I am also seeing below data in the logs. On one side it says, Matched files in the clover report as 99% which is good. & on other side, it says, 0/0 source files have been analysed. What does one make out of this?

INFO: Sensor org.sonar.plugins.clover.CloverSensor
INFO: 0/0 source files have been analyzed
INFO: Parsing C:\SonarQube\clover_xmlReport.xml
INFO: Matched files in report : 99%
WARN: 29 files in clover report did not match any file in SonarQube Index
INFO: Sensor org.sonar.plugins.clover.CloverSensor (done) | time=577ms

Please Help !!

###  Clover xml report snippet:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1474616508950" clover="4.0.2">
   <project timestamp="1474034151136">
      <metrics coveredelements="248984" complexity="108766" loc="908606" methods="43252" classes="5131" statements="250094" packages="692" coveredconditionals="50108" coveredmethods="29668" elements="382096" ncloc="568483" files="4572" conditionals="88750" coveredstatements="169208"/>
      <package name="com.common.encrypt">
         <metrics coveredelements="1739" complexity="744" loc="6004" methods="299" classes="37" statements="1838" coveredconditionals="315" coveredmethods="239" elements="2763" ncloc="3802" files="31" conditionals="626" coveredstatements="1185"/>
         <file path="C:\Users\Administrator\SonarQube_Source\ars\main\server\common\common\encrypt\ARCryptoConstants.java" name="ARCryptoConstants.java">
            <metrics coveredelements="0" coveredconditionals="0" complexity="1" loc="553" coveredmethods="0" methods="1" elements="1" classes="1" ncloc="242" statements="0" conditionals="0" coveredstatements="0"/>
            <class name="ARCryptoConstants">
               <metrics coveredelements="0" coveredconditionals="0" complexity="1" coveredmethods="0" methods="1" elements="1" statements="0" conditionals="0" coveredstatements="0"/>
            </class>
         </file>

         
### Sonar Qube Execution console Logs:

INFO: Java Main Files AST scan
INFO: 13251 source files to be analyzed
INFO: Java Main Files AST scan (done) | time=735591ms
INFO: 13251/13251 source files have been analyzed
WARN: Java bytecode has not been made available to the analyzer. The  are disabled.
INFO: Java Test Files AST scan
INFO: 0 source files to be analyzed
INFO: Java Test Files AST scan (done) | time=0ms
INFO: Sensor JavaSquidSensor (done) | time=736069ms
INFO: Sensor org.sonar.plugins.clover.CloverSensor
INFO: 0/0 source files have been analyzed
INFO: Parsing C:\SonarQube\xmlReport_Updated.xml
INFO: Matched files in report : 99%
WARN: 29 files in clover report did not match any file in SonarQube Index
INFO: Sensor org.sonar.plugins.clover.CloverSensor (done) | time=577ms
INFO: Sensor SCM Sensor
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: Sensor SCM Sensor (done) | time=1ms
INFO: Sensor SurefireSensor
INFO: parsing C:\SonarQube\JunitReports
INFO: Sensor SurefireSensor (done) | time=227ms
INFO: Sensor JaCoCoSensor
INFO: JaCoCoSensor: JaCoCo report not found : C:\Users\Administrator\SonarQube_Source\ars\main\server\target\jacoco.exec
INFO: Sensor JaCoCoSensor (done) | time=0ms
INFO: Sensor JaCoCoItSensor
INFO: JaCoCoItSensor: JaCoCo IT report not found: C:\Users\Administrator\SonarQube_Source\ars\main\server\target\jacoco-it.exec
INFO: Sensor JaCoCoItSensor (done) | time=0ms
INFO: Sensor JaCoCoOverallSensor
INFO: Sensor JaCoCoOverallSensor (done) | time=1ms
INFO: Sensor XmlFileSensor
INFO: Sensor XmlFileSensor (done) | time=61ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=1313ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=316ms
INFO: Sensor CPD Block Indexer
INFO: JavaCpdBlockIndexer is used for java
INFO: Sensor CPD Block Indexer (done) | time=13929ms
INFO: Calculating CPD for 10249 files

Daniel Mascarenhas

unread,
Sep 29, 2016, 8:27:29 AM9/29/16
to SonarQube
Any help?
To put the issue in simple words. I want to see the clover code coverage in the SonarQube. I am passing the clover xml report using the sonar.clover.reportPath. I have also passed the sureFire folder path for Junit results too. Yet, after running the scan. I dont see any clover or junit related data. Plz Help.

Thanks & Best Regards,
Daniel

Nicolas Peru

unread,
Sep 30, 2016, 4:33:28 AM9/30/16
to Daniel Mascarenhas, SonarQube
Hi, 

Note that clover is not officialy supported by SonarSource anymore. 

As far as I can tell from what you have shared your clover report seems pretty empty about the hit/miss lines in your file and that might be the reason of why you have nothing displayed. So you might want to double check your clover configuration. 

HTH, 
Cheers, 



--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/ef69e95a-264c-4ed7-b4ac-1d149e18a9f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

Daniel Mascarenhas

unread,
Sep 30, 2016, 5:19:50 AM9/30/16
to Nicolas Peru, SonarQube
Ok. Thanks Nicolas for kindly responding.

Actually, I am not sure, what data SonarQube is expecting in Clover.xml. Its not mentioned anywhere.
Moreover, I am novice to Clover. I need to ask developer here to get clover report generated. Can you please, tell, what specific Data (Apart from, hits & misses AND apart from data already generated like, <metrics coveredelements="248984" complexity="108766" loc="908606" methods="43252" classes="5131" statements="250094" packages="692" coveredconditionals="50108" coveredmethods="29668" elements="382096" ncloc="568483" files="4572" conditionals="88750" coveredstatements="169208"/>), What else should I ask him to generate clover report with?

Regards,
Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.

Nicolas Peru

unread,
Sep 30, 2016, 8:43:02 AM9/30/16
to Daniel Mascarenhas, SonarQube
Hi, 

note that this seems not aligned with the version of clover you are using, so there might be some need to upgrade the clover plugin  to make it parse 4.x clover reports. 

But once again, I am no clover expert and and this plugin is not supported by Sonarsource anymore. 

Cheers, 

To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages