Importing Apex Rules from Sonarqube into Illuminated Cloud 2

182 views
Skip to first unread message

daveonl...@gmail.com

unread,
Aug 7, 2018, 6:09:37 PM8/7/18
to Illuminated Cloud Q&A
Hello,
    We have a sonarqube server and we have set of apex rules running on the server.
Although we did setup IntelliJ IDE with Illuminated cloud 2 and configured Apex PMD in it. However, I did not find any way to export rules from sonarqube into our PMD plugin.
I thought of using sonar plugins like sonarlint, sonarqube community plugin but sadly they do not support apex (salesforce) language.
Is there a way to keep sonarqube as my ultimate source of rules ( either connecting it directly ) or export rules into xml and refer in PMD plugin.

I tried quite a few things but nothing seems to be working.
At present, IC2 does show me list of bugs but they are not exactly same as what we see in sonarqube and we want to keep it consistent.

Please let me know if you need more details.

Rgds
Dave

Scott

unread,
Aug 7, 2018, 6:20:56 PM8/7/18
to Illuminated Cloud Q&A
Dave, the last time I looked the existing first-class PMD plugins for IntelliJ IDEA, both the PMDPlugin and via things like QAPlug, are built specifically for certain languages, in particular Java. They don't include the PMD Apex functionality. IC runs PMD Apex a bit differently by driving the actual CLI in a mode that outputs structured results in XML format, then it presents those via IntelliJ IDEA's code inspection facility. Unfortunately there's not a good way to have IC's PMD integration point at something like Sonarqube for its managed ruleset. The best you could do is, as it sounds like you're doing, master the common PMD Apex rules distinctly and have both Sonarqube and IC's PMD Apex code inspection point at those.

I hope that helps. Let me know if you have other questions.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages