2
  1. I have installed ApexPmd plugin for Eclipse(Luna).

  2. After installation I can able to "Run ApexPMD" for individual Class.

  3. (a) There is an option “Add ApexPMD Nature” providing by the ApexPMD, where it will run automatically while saving the class. (b) But, this option (Add ApexPMD Nature) is not working for me. I can able to see the violation list when I run ApexPMD for specific class. Not able to do while saving.

Any more configuration to be done to work this(Add ApexPMD Nature) feature. In ApexPmd plugin.


This is the place where i have enabled PMD.

enter image description here

2
  • Let us continue this discussion in chat. Commented Feb 27, 2017 at 11:22
  • 1
    There are two PMD out there. The closed-source PMD by VillageChief that you have to pay for. It's called ApexPMD and this seems to be what you have installed. But then there is also the original, free and open-source PMD pmd.github.io. I recommend uninstalling ApexPMD and closing this question. Create a new one just describing your issues getting PMD and its Eclipse plugin to work. Commented Oct 18, 2017 at 21:48

1 Answer 1

2

Did you check the checkbox to enable PMD from project properties? right click on project>> Properties >> Click on PMD(or whatever name you have given while installing the PMD plugIn) >> at top left corner you will see the checkbox Enable PMD!

You can find the latest version of PMD here:-
https://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/

Details about How add new PMD rule:-
https://github.com/Up2Go/codeclimate-apexmetrics/wiki/add-a-new-rule-for-apex-pmd

PMD Git Repository:-
https://github.com/Up2Go/codeclimate-apexmetrics

Blog by Jitendra Zaa this will surly help you to get idea of PMD:-
http://www.jitendrazaa.com/blog/salesforce/automated-code-review-for-apex-in-salesforce-static-code-analysis-video/

enter image description here

1
  • @B SFDC I have updated my answer, this will surly help you to get idea about PMD and how to add custom rule in existing PMD ruleset for Apex. Commented Feb 27, 2017 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .