PMD Plugin Status

java

(Jeff Mathers) #1

The PMD plugin does not seem to be maintained anymore. I know that many of the rules have been implemented in the Java plugin. PMD itself can be used to scan other languages when running it on the command line. Does the SonarQube plugin work only with Java?

jeff


(G Ann Campbell) #2

Hi,

Yes, I believe so.

 
Ann


(Jeff Mathers) #3

Thanks Ann!

Yeah I dug thru the source and it looks like it only is looking at Java code.

I guess we will have to disable this since it does not support recent versions of Java. The only rule that is not supported in the SonarJava that I want is the “GodClass” rule.

jeff


(Alexandre Gigleux) #6

Hello Jeff,

If “GodClass” is the only missing rule from PMD that prevents you to use SonarJava, I suggest you to create a custom rule.
Here are some links to start that activity:

Alex


(Jens Gerdes) #7

Hi @Jeff_Mathers

you’re right, the sonar-pmd plugin did not receive much love during the last two years.
It’s got many problems (no support for SonarQube 7.3+, no support for Java >= 9).
However, things might brighten up within the next months.

I’ve recently taken over this project and am already preparing the next release which will, as a first step, support newer SonarQube versions.

Next planned milestones:

  • Update from PMD 5.4 => 6.8 - which introduces Java 10 support
  • Update of the existing PMD ruleset - I haven’t had the time to check but there might be many interesting rules we are not using within the plugin.

By the way - PMD itself has the capability to analyze more than just Java (JavaScript, XML, XSL, PLSQL). We might probably open the plugin for other languages.

Regards
Jens


(Jeff Mathers) #8

That sounds pretty good to me. Will the plugin’s scanning move beyond Java? That would definitely be interesting.

jeff


(Jens Gerdes) #9

I can’t say it will at the moment - but it might. For me, coming from a Java world, this does not have the highest priority although it definitely sounds interesting.

May I suggest that you create a new issue in the sonar-pmd repository so that we don’t forget about this feature request?

Finally, pull requests are always welcome. So, if you want to speed up things regarding the mentioned feature… :wink:


(G Ann Campbell) #10

I’ll just point out that SonarJava does some cross-language analysis on pom.xml files even though it doesn’t declare/own the language. So if you’re really interested, you might be able to get some pointers from its code.

 
Ann