PMD static analysis for Salesforce Apex using the command line

Here, we can run a PMD analysis on all files by using a single command. The steps are as follows:

  1. First, download the PMD JAR file from https://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/, and then take a look at this screenshot:
  1. Extract the JAR file, go inside the bin file, and copy the path of that folder.
  2. Now, open Run by pressing Windows + R and enter the command to open the command-line panel.
  3. Go to your bin path by entering the path of that folder. If you are on another drive, then first go to that drive and enter the copied path:
  1. Now, create your command: ...

Get DevOps for Salesforce now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.