Fail to execute sonar PMD - jenkins

We are using sonar 4.5.1 and sonar-pmd-plugin is 2.3. From last few days , I am facing issue of "too many open files " Fail to execute PMD. Following file is ignored. I found that issue is fixed in 2.4 but we cannot upgrade the plugin as it would also need upgrade to Sonar 4.5.2 version. Is there any fix or workaround for the issue ? Kindly help. We use Jenkins 1.580, Sonar 4.5.1,Maven 3.0.4.

Related

File does not exist in SonarQube analysis

When analyzing C# project with TFS 2015 vNext build, I get the following error:
The folder
'D:\Builds_Agent1_work\4\s\System\IPS\Files\Logo\MasterDesigns\Logo_11_Seal_of_Pinellas_County'
does not exist for
'DEV_ScriptAdvisorPBM_SonarQube:DEV_ScriptAdvisorPBM_SonarQube:9C5E1BB5-E446-45C8-9CE6-5F9896D0D063'
(base directory = D:\Builds_Agent1_work\4\s\System\IPS)
I think it's because there is a file called "Logo_11_Seal_of_Pinellas_County,_Florida.png" but SonarQube thinks it's "Logo_11_Seal_of_Pinellas_County".
I tried /d:sonar.exclusions=**\MasterDesigns\* to ignore the entire directory where "Logo_11_Seal_of_Pinellas_County,_Florida.png" is located but still same error.
Any suggestions to fix this issue? Thx.
SonarQube 6.5 C# plugin.
This bug is tracked by SONARMSBRU-199 which was fixed in the Scanner for MSBuild v4.1.
The bug report as mentions a workaround for excluding a single file.
FYI support for MSBuild 12 was dropped in the Scanner for MSBuild v4, so if you upgrade the version you will need to make sure you are using a compatible version of MSBuild.

Ant sonar command not works

I am trying to insert sonarqube setup on build.xml, getting unsupported error.
My build Java version support 1.6
Ant.sonar.qube support 2.5
If I use have version 1.8 my ant sonar command is working.ant command is not working.if I use java 1.6 ant is working and ant sonar is not working.
You already know exactly what your problem is:
If I use have version 1.8 my ant sonar command is working
...
if I use java 1.6 ant is working and ant sonar is not working.
You're facing incompatibility with the version of Java you're trying to use. Since analysis will not work with 1.6, you're best off upgrading to Java 8 and working to make whatever your other Ant target is work with that.

Technical Debt showing Zero in Sonar

I am using Jenkins for CI and added the sonar plugins for Jenkins. After sonar scan Technical Debt shown Zero.
But actually its is not zero previously was using latest version of sonar there it was showing Technical Debt but after downgrading it is not shown .(Duplicate code ,Lines of code ,complexity are shown)
Below are the version of sonar used
Before Downgrading following version are used (Working fine)
sonar scanner 2.5.1 , Sonar Plugin 2.3 , SonarQube 5.4 , Jenkins version. 1.651
After Downgrading (Technical Debt not shown)
Sonar scanner 2.5, sonar plugin 2.1 , SonarQube 4.5 , Jenkins version 1.651
How this problem can be solved ?
Thanks
Ganesh
I found the reason for this , posting here so that it can be helpful for others.
In latest version of SonarQube 5.4 there is no need to refer to 'binaries' ,from 'src' only Technical Debt will be calculated.But in case of older version 4.5 need to refer binaries also for sonar scan(Because find-bugs requires binaries in new one find bugs are integrated to sonar way profile)
I had the same problem, I missed deleting data/es folder during upgrade process. After deleting the data/es folder and restarting the sonarqube server solved my problem. More information is here

Sonar ant task: PmdSensor throws UnsupportedOperationException after update to SonarQube 4.4

After updating my SonarQube installation from 4.1.1 to 4.4 I always get the error
Caused by: org.sonar.api.utils.XmlParserException: java.lang.UnsupportedOperationException: Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:55)
...
when running the ant task configured as suggested in:
http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Ant+Task
and
http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Ant+Task
What can I do to fix that?
This matrix should be a good reference when you do an upgrade - http://docs.sonarqube.org/display/SONAR/Plugin+version+matrix
Today I upgraded sonarqube to v 4.4 and got it fully working with this set of plugins -
SONARQUBE PLUGINS
Checkstyle 2.1
Findbugs 2.4 (recommended version is 3.0 but my source code is Java 1.6)
Java 2.4
PMD 2.2
I was facing exactly the same issue as you were, so I m hoping that this combination should work for you as well! Goodluck!

Emma does not recognize [ctl] command in Java7

I am using the latest version of Emma i.e. 2.0.5312 and Java 7.
If I run the following command to get the coverage.ec on the fly, I get an error.
java emma ctl -connect localhost:47653 -command coverage.get,coverage.ec
*Exception in thread "main" java.lang.IllegalArgumentException: unknown command:
[ctl]
at com.vladium.emma.Command.create(Command.java:51)
at emma.main(emma.java:39)*
This error is usually seen if an older version of Emma is used but I believe build 5312 is the latest build of Emma. Also, this error is not seen in Java 6.
Has someone come across this issue and been able to resolve it? Any pointers will be very much appreciated.
The latest and last version of Emma is 2.1.5320. I downloaded this version and was able to overcome the above mentioned error.

Resources