2

I am trying to use PMD in IntelliJ IDE using illuminated cloud. When I run PMD using pre-defined rules, no violations are reported. When I try to import custom rules from PMD's website, it does not load the custom rules and throws an error as shared in attachment. enter image description here

Just to be clear, I am trying to run PMD for salesforce( apex) rules and want to see the bugs/errors from PMD in the IDE itself. I have searched all over the internet, did not find any support for it. Does PMD on intelliJ support apex ? Has anyone here used PMD in IntelliJ IDE and able to see the static code review comments ?

  • Is that plugin perhaps using a very old version of PMD? The rules format underwent a significant change. (I don't use IntelliJ myself) – David Reed Aug 6 '18 at 22:08
  • @Scott Wells would know =) – glls Aug 6 '18 at 22:10
  • I am using the latest version from the plugin repository. The rules are also up to date. – Dave Aug 6 '18 at 22:20
  • 4
    That's not actually how you use PMD from within Illuminated Cloud. You can uninstall PMDPlugin from IntelliJ IDEA. Open Settings>Editor>Inspections, then select Salesforce>PMD Apex. You'll need to configure a PMD executable and PMD ruleset. The inspection configuration includes links to download the latest versions of both. Once installed, specify the paths to pmd.bat/run.sh and the ruleset XML file respectively. You can then run the inspection using Analyze>Run Inspection by Name. Let me know if that doesn't help! – Scott Wells Aug 6 '18 at 23:43
4

Here's my IC 2 setup. The IDE has direct links to the files you need to have a path available from your local machine

enter image description here

  • Thanks @cropredy , Scott Wells. that helps in getting the issue resolved. Appreciate your support. – Dave Aug 7 '18 at 21:00
  • 3
    @Dave - Scott gives terrific support on his Illuminated Cloud Q&A support forum that I have used multiple times to post even 'newbie' questions and Scott answers promptly and cheerfully – cropredy Aug 7 '18 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.