Skip to content

Running the Force.com CLI and PMD for a quick quality check

  1. Install the force.com CLI, confirm it runs from your current working directory by running ‘force’
  2. Install PMD, confirm it runs from your current working directory by running PMD

Then, run the following commands in sequence

cd <target directory>
mkdir metadata
force login
force export ApexClass
pmd -d metadata\classes -R rulesets/apex/ruleset.xml -f html -reportfile report.html
report.html 

I then cut and paste the report.html contents from browser to Excel for subsequent review and processing.

Leave a Reply

Your email address will not be published. Required fields are marked *