Skip to content

joseph-allen-tc/vscode-apex-pmd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apex-pmd

Allows you to run Apex Static Analysis directly in vscode.

Features

Apex PMD

Current actions Supported

  • Run analysis on file open
  • Run analysis on file save
  • Run analysis on entire workspace
  • Run analysis on single file
  • Ability to define your own ruleset

Installation

  1. Must have JDK >=1.4 installed and in path
  2. Download a PMD "bin" release (>= 5.6)
  3. unzip to location of choice
  4. In VScode, Open Preferences: User Settings and set apexPMD.pmdPath to folder where pmd was unzipped in step 3

Configuration

    // absolute path to where PMD was installed
    "apexPMD.pmdPath": "/Users/johndoe/pmd",

    // Set to false to use you own ruleset (set path)
    "apexPMD.useDefaultRuleset": true,

    // Path to ruleset xml file.  Must also set `useDefaultRuleset:false`.
    // If relative - current workspace root dir is used as a starting point
    "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

Defining your own "Ruleset"

I recommend you use the default ruleset as a starting point.

Set "apexPMD.useDefaultRuleset": false and update apexPMD.rulesetPath to reference your custom ruleset.

Apex Ruleset Reference

About

PMD static analysis for Apex in vscode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%