Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>VSCode Apex PMDNew to Visual Studio Code? Get it now.
VSCode Apex PMD

VSCode Apex PMD

mohanchinnappan

|
13,110 installs
| (0) | Free
PMD static code analysis for Salesforce Apex. This is based on the original work by Chuck Jonas
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

logo

VSCode Extension for PMD code scan for Salesforce Apex

Allows you to run Apex Static Code Analysis directly in VSCode.

This is based on the original work by Chuck Jonas

ANT task based PMD

If you are looking for ANT task based PMD for Apex, here it is.

Features Demo

Demo for the Extension

Current actions Supported

Run analysis on:

  • file open
  • file save
  • entire workspace
  • single file

Installation

  1. Must have JDK >=1.4 installed and in path
  2. Download a PMD "bin" release (>= 5.6)
  3. unzip the zip file from step #2 to location of choice and make a note of that location. This is the value for : apexPMD.pmdPath
  4. In VSCode, Open Preferences: User Settings and set apexPMD.pmdPath to folder where pmd was unzipped in step 3 along with other config items as shown below:

Sample Configuration -> VSCode::Preferences: User Settings


{
     // ...

    // absolute path to where PMD was installed
    // following example in my case
    "apexPMD.pmdPath":"/Users/mchinnappan/code-scan-tools/pmd/pmd-bin-5.8.1",
    // Set to false to use you own ruleset (set path)
     "apexPMD.useDefaultRuleset": "true",

     // Absolute path to ruleset xml file.  Must also set `useDefaultRuleset:false`.
    "apexPMD.rulesetPath": "",
    
    // Will run static analysis every time a file is opened
    "apexPMD.runOnFileOpen": "true",

    // Will run static analysis every time a file is saved
    "apexPMD.runOnFileSave": "true",

    // Determines at what priority level 'errors' will be added. Anything less will be a warning or hint
    "apexPMD.priorityErrorThreshold": "1",

    // Determines at what priority level 'warnings' will be added. Anything less will be a hint
    "apexPMD.priorityWarnThreshold": "3"

}


Ruleset

Here is the sample ruleset used in this extension

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft