PMD - Don't shoot the messenger

PMD

An extensible cross-language static code analyzer.



Latest Version: 5.8.1 (1st July 2017)
Release Notes | Download | Documentation


QuickStart


See Installation and Command Line Usage
$ cd $HOME
$ wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.8.1/pmd-bin-5.8.1.zip
$ unzip pmd-bin-5.8.1.zip
$ alias pmd="$HOME/pmd-bin-5.8.1/bin/run.sh pmd"
$ pmd -d /usr/src -R java-basic -f text
$ cd $HOME
$ curl -OL https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.8.1/pmd-bin-5.8.1.zip
$ unzip pmd-bin-5.8.1.zip
$ alias pmd="$HOME/pmd-bin-5.8.1/bin/run.sh pmd"
$ pmd -d /usr/src -R java-basic -f text
  1. Download pmd-bin-5.8.1.zip
  2. Extract the zip-archive, e.g. to C:\pmd-bin-5.8.1
  3. Add folder C:\pmd-bin-5.8.1\bin to PATH, either
    1. Permanently: Using System Properties dialog > Environment variables > Append to PATH variable
    2. Temporarily, at command line: SET PATH=C:\pmd-bin-5.8.1;%PATH%
  4. Execute at command line: pmd.bat -d c:\src -R java-basic -f text
Checkout the existing rules.


About PMD


PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce, PLSQL, Apache Velocity, XML, XSL.

Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code in Java, C, C++, C#, Groovy, PHP, Ruby, Fortran, JavaScript, PLSQL, Apache Velocity, Scala, Objective C, Matlab, Python, Go, Swift and Salesforce.com Apex and Visualforce.




Support


Need help?

Get Involved

See How to contribute to PMD and How to build PMD.
Our license: BSD-style.