Welcome to PMD, an extensible cross-language static code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code.
Edit me
PMD Logo

PMD scans source code in Java and other languages and looks for potential problems like:

  • Possible bugs - empty try/catch/finally/switch statements
  • Dead code - unused local variables, parameters and private methods
  • Suboptimal code - wasteful String/StringBuffer usage
  • Overcomplicated expressions - unnecessary if statements, for loops that could be while loops

CPD, the copy-paste-detector, finds duplicated code in many languages:

  • Duplicate code is often just copied and pasted. This means, the bugs are also copied and pasted. Fixing them means, fix all duplicated code locations.




  • Supporting 8 languages
  • Many ready-to-use built-in rules.
  • Custom rules can be written in Java
  • Custom rules can be written using XPath expression that query the AST of the sources
  • Many output formats
  • Many integrations into IDEs, build tools

Supported Languages:



  • Supporting 19 languages
  • Simple GUI
  • Fast
  • Many integrations

Supported Languages:

  • Java
  • C, C++
  • C#
  • Groovy
  • PHP
  • Ruby
  • Fortran
  • JavaScript
  • Apache Velocity
  • Scala
  • Objective C
  • Matlab
  • Python
  • Go
  • Swift
  • Salesforce.com Apex and Visualforce

Download PMD 6.2.0

Latest Version: 6.2.0 (2018-03-26)