##### Overview

- Download PMD 5.0.4
- What's new in PMD 5.0.4
- PMD in the news
- PMD-related products and books
- Best practices
- Future directions
- Similar projects
- Credits
- License
- What does 'PMD' mean?

##### Usage

- Installation
- Command line usage
- Ant task usage
- Maven plugin usage
- Mvn plugin usage
- IDE plugin usage
- Suppressing warnings
- Finding duplicated code
- JSP support

##### Customizing PMD

- Compiling PMD
- How to write a rule
- Writing XPath rules
- How to make a rule set
- How it works
- Rule guidelines
- PMD developers information
- PMD Release Process

##### For example

- Run PMD on a Sourceforge project

##### Misc.

- XPath tutorial (Gregorian)

##### Rule Sets

- ecmascript
  - Basic Ecmascript
  - Braces
  - Unnecessary
- java
  - Android
  - Basic
  - Braces
  - Clone Implementation
  - Code Size
  - Comments
  - Controversial
  - Coupling
  - Design
  - Empty Code
  - Finalizer
  - Import Statements
  - J2EE
  - JavaBeans
  - JUnit
  - Jakarta Commons Logging
  - Java Logging
  - Migration
  - Naming
  - Optimization
  - Strict Exceptions
  - String and StringBuffer
  - Security Code Guidelines
  - Type Resolution
  - Unnecessary
  - Unused Code
- jsp
  - Basic JSF
  - Basic JSP
- xml
  - Basic XML
- xsl
  - XPath in XSL

##### Project Documentation

- Project Information
- Project Reports

## Welcome to PMD

PMD scans Java source code 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
- Duplicate code - copied/pasted code means copied/pasted bugs

You can download everything from here, and you can get an overview of all the rules at the rulesets index page.

PMD is integrated with JDeveloper, Eclipse, JEdit, JBuilder, BlueJ, CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.

### Recent releases

- 2013-05-01 PMD 5.0.4: minor version with lots of bug fixes (Changelog)

  - Fixed bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-5.0.4/

- 2013-04-05 PMD 5.0.3: minor version with lots of bug fixes (Changelog)

  - Fixed bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-5.0.3/

- 2013-02-03 PMD 5.0.2: minor version with lots of bug fixes (Changelog)

  - Fixed bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-5.0.2/

- 2012-11-28 PMD 5.0.1: minor version with lots of bug fixes (Changelog)

  - Fixed bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-5.0.1/
  - New EcmaScript Rule: Basic ruleset: AvoidTrailingComma
  - Improved JSP parser to be less strict with not valid XML documents (like HTML)
  - Improved CPD: Support in CPD for IgnoreAnnotations and SuppressWarnings("CPD-START")
  - PMD Command Line: Improved command line interface (CLI) parsing using JCommander.

- 2012-05-01 PMD 5.0.0: major version supporting additional languages and new rules (Changelog)

  - Additional languages support (Java, JavaScript, XML, XSL, JSP)
  - Many bug fixes and new rules
  - Internal refactoring which breaks compatibility, but adds generic support for additional languages.
  - Maven coordinates have been changed: net.sourceforge.pmd:pmd
  - For details, see the Changelog.

  Note: PMD 5 is not backwards compatible with PMD 4.x.

- 2011-11-04 PMD 4.3 (download):

  - Add support for Java 7 grammer - thanks to Dinesh Bolkensteyn and SonarSource ;
  - Add C# support for CPD - thanks to Florian Bauer ;
  - And, as usual, a bunch of bug fixes and a couple new rules (DontCallThreadRun and GuardDebugLogging) (See Changelog).
  Note: default JDK setting for PMD is now Java 7.
- 2011-09-14 PMD 4.2.6: bug fixes, new rules (Changelog)
- 2009-02-08 PMD 4.2.5: bug fixes, new rule, new Android ruleset (Changelog)
- 2008-10-12 PMD 4.2.4: bug fixes (Changelog)
- 2008-08-31 PMD 4.2.3: yet more bug fixes (Changelog)
- 2008-05-20 PMD 4.2.2: more bug fixes on the 4.2 branch (Changelog)
- 2008-04-11 PMD 4.2.1: bug fixes (Changelog)

### Future releases

The next development version will be PMD 5.1. We will release other 5.0.x versions with bug fixes if needed.

A snapshot of the web site for the new version is generated daily by our continuous integration server. Early access versions can also be downloaded from there.