Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
Hi,
I have recently upgraded Sonar from Version 3.4.1 to Sonarqube 4.3.2. I am using Cobertura version 1.6.2 and Java plugin 2.3 in Sonar.The Unit Tests Success% is same that is 100% in both the cases but there is difference in the Code Coverage% being displayed (Earlier it was 22.7% and now in Sonarqube 4.3.2,it is 15.9%).The difference is significant.Also there is difference in the Lines of Code after upgradation (Earlier it was 1,906 and after upgradation it is 2,704).Anyone having idea that what can be the reason for this difference.
Any help is appreciated.Thanks in advance.

Kind Regards,
Inder
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
I am still facing this issue.Can anyone help me?
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

Nicolas Peru
Hi, 

Given the number you are giving it seems that the coverage hasn't moved but the difference is due to the number of lines of code that have changed (22.7% of 1906 ~= 15.9% of 2704). 
it has not changed for a long time. 
Are you sure you are not using some exclusions patterns on old analysis ? or are you sure your code has not changed ?
Can you spot from which files the difference comes from by drilling down into modules and packages ? 

Cheers,


Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com



On 26 August 2014 11:50, inkaur <[hidden email]> wrote:
I am still facing this issue.Can anyone help me?



--
View this message in context: http://sonarqube.15.x6.nabble.com/Difference-in-Code-Coverage-after-upgradation-from-Sonar-3-4-1-to-Sonarqube-4-3-2-tp5027611p5027695.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
Thanks for your reply. There had not been any code change.There were definetly exclusion patterns used in sonar 3.4.1 (before upgrade) which were mentioned in pom.xml.
We came to know that in sonar 4.3.2, the exclusions should be mentioned on Sonar interface. So we mentioned it under Project name->Category->Exclusions->Files->Source File Exclusions.
The exclusions mentioned were: js/lib/*.js,auth/js/lib/**/*.js,js/lib/**/**/*.js
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
Lines of Code before upgrade :-



Lines of Code after upgrade :-



Kindly notice the difference between lines of code.Can anyone let me know the reason for this.
Any help is appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

Nicolas Peru
Hi, 

Would you be able to drill down into lines before and after so you can spot from which files the difference might come ? 

Cheers,

Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com


On 16 September 2014 11:57, inkaur <[hidden email]> wrote:
Lines of Code before upgrade :-

<http://sonarqube.15.x6.nabble.com/file/n5028287/Before_upgrade.png>

Lines of Code after upgrade :-

<http://sonarqube.15.x6.nabble.com/file/n5028287/After_upgrade_to_4.png>

Kindly notice the difference between lines of code.Can anyone let me know
the reason for this.
Any help is appreciated.



--
View this message in context: http://sonarqube.15.x6.nabble.com/Difference-in-Code-Coverage-after-upgradation-from-Sonar-3-4-1-to-Sonarqube-4-3-2-tp5027611p5028287.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
We drilled down the files and there is difference of 13 files which are not getting excluded in the new sonar version (4.3.2) despite mentioning their path in project settings->exclusions->Files->Source File Exclusions. what to do so that the exclusions are considered ?
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

Freddy Mallet
Before SonarQube 4.2 the package/directory separator in exclusion patterns was '.' but since version 4.2, this is '/'. Fixing your exclusion patterns should fix your issue.

++

-----
SonarQube for Continuous Inspection

On Thu, Sep 18, 2014 at 2:37 PM, inkaur <[hidden email]> wrote:
We drilled down the files and there is difference of 13 files which are not
getting excluded in the new sonar version (4.3.2) despite mentioning their
path in project settings->exclusions->Files->Source File Exclusions. what to
do so that the exclusions are considered ?




--
View this message in context: http://sonarqube.15.x6.nabble.com/Difference-in-Code-Coverage-after-upgradation-from-Sonar-3-4-1-to-Sonarqube-4-3-2-tp5027611p5028350.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

inkaur
We have mentioned the excluded source files as in the below format: src/main/java/js/lib/**/**/*.js
src/main/webapp/js/lib/*.js . I understand that is only you referred to ?
Before upgrade, when we had Sonar 3.4.1, the exclusions were mentioned in pom.xml in the same format and were considered: <sonar.exclusions>js/lib/*.js,auth/js/lib/**/*.js</sonar.exclusions>
 Is there some other '.' to be replaced by '/' ?
Reply | Threaded
Open this post in threaded view
|

Re: Difference in Code Coverage% after upgradation from Sonar 3.4.1 to Sonarqube 4.3.2

Freddy Mallet
If your exclusions are correctly specified, you should figure out where those 800 additional lines of code are coming from. If you fix that, I'm pretty sure that will also fix your code coverage. 

++

-----
SonarQube for Continuous Inspection

On Tue, Sep 23, 2014 at 9:27 AM, inkaur <[hidden email]> wrote:
We have mentioned the excluded source files as in the below format:
src/main/java/js/lib/**/**/*.js
src/main/webapp/js/lib/*.js . I understand that is only you referred to ?
Before upgrade, when we had Sonar 3.4.1, the exclusions were mentioned in
pom.xml in the same format and were considered:
<sonar.exclusions>js/lib/*.js,auth/js/lib/**/*.js</sonar.exclusions>
 Is there some other '.' to be replaced by '/' ?



--
View this message in context: http://sonarqube.15.x6.nabble.com/Difference-in-Code-Coverage-after-upgradation-from-Sonar-3-4-1-to-Sonarqube-4-3-2-tp5027611p5028423.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email