Pmd is a tool for running code static analysis for multiple languages. The first thing you need to use it is download it from Pmd’s website. Clicking the download button will download a zip file. Uncompress that zip and you will have all you need.
Running code static analysis
Once you have pmd on your computer you can analyse your code using this command:
1 <path to pmd>/bin/run.sh pmd -d <src folder> -l java -f <reporting format> -R <rules>