##### 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 Summary
  - Dependencies
  - Project Team
  - Mailing Lists
  - Continuous Integration
  - Issue Tracking
  - Project License
  - Source Repository
- Project Reports

## Project Dependencies

### compile

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

GroupId | ArtifactId | Version | Classifier | Type | License
--- | --- | --- | --- | --- | ---
asm | asm | 3.2 | - | jar | BSD
com.beust | jcommander | 1.27 | - | jar | The Apache Software License, Version 2.0
commons-io | commons-io | 2.2 | - | jar | The Apache Software License, Version 2.0
jaxen | jaxen | 1.1.1 | - | jar | -
junit | junit | 4.4 | - | jar | Common Public License Version 1.0
net.java.dev.javacc | javacc | 4.1 | - | jar | The BSD License
net.sourceforge.saxon | saxon | 9.1.0.8 | dom | jar | Mozilla Public License Version 1.0
net.sourceforge.saxon | saxon | 9.1.0.8 | - | jar | Mozilla Public License Version 1.0
org.apache.ant | ant | 1.8.1 | - | jar | -
org.apache.ant | ant-testutil | 1.7.1 | - | jar | -
org.mozilla | rhino | 1.7R3 | - | jar | Mozilla Public License, Version 1.1-GNU General Public License, Version 2

### runtime

The following is a list of runtime dependencies for this project. These dependencies are required to run the application:

GroupId | ArtifactId | Version | Type | License
--- | --- | --- | --- | ---
xerces | xercesImpl | 2.9.1 | jar | The Apache Software License, Version 2.0

### test

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

GroupId | ArtifactId | Version | Type | License
--- | --- | --- | --- | ---
org.apache.commons | commons-lang3 | 3.1 | jar | The Apache Software License, Version 2.0
org.mockito | mockito-all | 1.9.5 | jar | The MIT License

## Project Transitive Dependencies

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

### compile

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

GroupId | ArtifactId | Version | Type | License
--- | --- | --- | --- | ---
dom4j | dom4j | 1.6.1 | jar | -
jdom | jdom | 1.0 | jar | -
org.apache.ant | ant-launcher | 1.8.1 | jar | -
xerces | xmlParserAPIs | 2.6.2 | jar | -
xml-apis | xml-apis | 1.3.02 | jar | -
xom | xom | 1.0 | jar | LGPL

## Project Dependency Graph

### Dependency Tree

- net.sourceforge.pmd:pmd:jar:5.0.4

  PMD

  Description: <p>PMD scans Java source code and looks for potential problems like:</p> <ul> <li>Possible bugs - empty try/catch/finally/switch statements</li> <li>Dead code - unused local variables, parameters and private methods</li> <li>Suboptimal code - wasteful String/StringBuffer usage</li> <li>Overcomplicated expressions - unnecessary if statements, for loops that could be while loops</li> <li>Duplicate code - copied/pasted code means copied/pasted bugs</li> </ul> <p>You can <b><a href="http://sourceforge.net/project/showfiles.php?group_id=56262">download everything from here</a></b>, and you can get an overview of all the rules at the <a href="rules/index.html">rulesets index</a> page.</p> <p>PMD is <a href="integrations.html">integrated</a> with JDeveloper, Eclipse, JEdit, JBuilder, BlueJ, CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.</p>

  URL: http://pmd.sourceforge.net/

  Project License: BSD-style

  - org.apache.ant:ant:jar:1.8.1 (compile)

    org.apache.tools.ant
    Description: Apache Ant URL: http://ant.apache.org/ant/ Project License: No project license is defined for this project.

    - org.apache.ant:ant-launcher:jar:1.8.1 (compile)

      ant-launcher
      Description: master POM URL: http://ant.apache.org/ant-launcher/ Project License: No project license is defined for this project.

  - org.apache.ant:ant-testutil:jar:1.7.1 (compile)

    ant-testutil
    Description: test utility classes URL: http://ant.apache.org/ant-testutil/ Project License: No project license is defined for this project.

  - jaxen:jaxen:jar:1.1.1 (compile)

    jaxen
    Description: Jaxen is a universal Java XPath engine. URL: http://jaxen.codehaus.org/ Project License: No project license is defined for this project.

    - dom4j:dom4j:jar:1.6.1 (compile)

      dom4j
      Description: dom4j: the flexible XML framework for Java URL: http://dom4j.org Project License: No project license is defined for this project.

    - jdom:jdom:jar:1.0 (compile)

      jdom
      Description: There is currently no description associated with this project. Project License: No project license is defined for this project.

    - xml-apis:xml-apis:jar:1.3.02 (compile)

      xml-apis
      Description: There is currently no description associated with this project. URL: http://xml.apache.org/commons/#external Project License: No project license is defined for this project.

    - xom:xom:jar:1.0 (compile)

      xom
      Description: There is currently no description associated with this project. URL: http://www.xom.nu Project License: LGPL

      - xerces:xmlParserAPIs:jar:2.6.2 (compile)

        xmlParserAPIs
        Description: There is currently no description associated with this project. Project License: No project license is defined for this project.

  - com.beust:jcommander:jar:1.27 (compile)

    JCommander
    Description: A Java framework to parse command line options with annotations. URL: http://beust.com/jcommander Project License: The Apache Software License, Version 2.0

  - asm:asm:jar:3.2 (compile)

    ASM Core
    Description: A very small and fast Java bytecode manipulation framework URL: http://asm.objectweb.org/asm/ Project License: BSD

  - net.sourceforge.saxon:saxon:jar:9.1.0.8 (compile)

    SaxonB
    Description: Saxon a complete and conformant implementation of the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations published on 23 January 2007 by W3C URL: http://saxon.sourceforge.net/ Project License: Mozilla Public License Version 1.0

  - net.sourceforge.saxon:saxon:jar:dom:9.1.0.8 (compile)

    SaxonB
    Description: Saxon a complete and conformant implementation of the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations published on 23 January 2007 by W3C URL: http://saxon.sourceforge.net/ Project License: Mozilla Public License Version 1.0

  - org.mozilla:rhino:jar:1.7R3 (compile)

    Mozilla Rhino
    Description: Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. URL: http://www.mozilla.org/rhino/ Project License: Mozilla Public License, Version 1.1 GNU General Public License, Version 2

  - junit:junit:jar:4.4 (compile)

    JUnit
    Description: JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. URL: http://junit.org Project License: Common Public License Version 1.0

  - xerces:xercesImpl:jar:2.9.1 (runtime)

    Xerces2 Java Parser

    Description: Xerces2 is the next generation of high performance, fully compliant XML parsers in the Apache Xerces family. This new version of Xerces introduces the Xerces Native Interface (XNI), a complete framework for building parser components and configurations that is extremely modular and easy to program.

    URL: http://xerces.apache.org/xerces2-j

    Project License: The Apache Software License, Version 2.0

  - net.java.dev.javacc:javacc:jar:4.1 (compile)

    JavaCC
    Description: JavaCC is a parser/scanner generator for Java. URL: http://javacc.dev.java.net/ Project License: The BSD License

  - commons-io:commons-io:jar:2.2 (compile)

    Commons IO
    Description: The Commons IO library contains utility classes, stream implementations, file filters, file comparators, endian transformation classes, and much more. URL: http://commons.apache.org/io/ Project License: The Apache Software License, Version 2.0

  - org.mockito:mockito-all:jar:1.9.5 (test)

    Mockito
    Description: Mock objects library for java URL: http://www.mockito.org Project License: The MIT License

  - org.apache.commons:commons-lang3:jar:3.1 (test)

    Commons Lang
    Description: Commons Lang, a package of Java utility classes for the classes that are in java.lang's hierarchy, or are considered to be so standard as to justify existence in java.lang. URL: http://commons.apache.org/lang/ Project License: The Apache Software License, Version 2.0

## Licenses

Mozilla Public License, Version 1.1: Mozilla Rhino

LGPL: xom

GNU General Public License, Version 2: Mozilla Rhino

Unknown: ant-launcher, ant-testutil, dom4j, jaxen, jdom, org.apache.tools.ant, xml-apis, xmlParserAPIs

BSD: ASM Core

BSD-style: PMD

Mozilla Public License Version 1.0: SaxonB

Common Public License Version 1.0: JUnit

The Apache Software License, Version 2.0: Commons IO, Commons Lang, JCommander, Xerces2 Java Parser

The MIT License: Mockito

The BSD License: JavaCC

## Dependency File Details

Filename | Size | Entries | Classes | Packages | JDK Rev | Debug | Sealed
--- | --- | --- | --- | --- | --- | --- | ---
asm-3.2.jar | 42.38 kB | 24 | 23 | 2 | 1.2 | release | -
jcommander-1.27.jar | 54.28 kB | 59 | 45 | 5 | 1.5 | debug | -
commons-io-2.2.jar | 169.52 kB | 126 | 108 | 6 | 1.5 | debug | -
dom4j-1.6.1.jar | 306.54 kB | 208 | 190 | 14 | 1.3 | debug | -
jaxen-1.1.1.jar | 221.60 kB | 236 | 214 | 17 | 1.2 | debug | -
jdom-1.0.jar | 149.66 kB | 87 | 75 | 8 | 1.1 | debug | -
junit-4.4.jar | 157.69 kB | 188 | 154 | 20 | 1.5 | debug | -
javacc-4.1.jar | 282.56 kB | 161 | 152 | 5 | 1.4 | release | -
saxon-9.1.0.8-dom.jar | 126.21 kB | 38 | 32 | 1 | 1.4 | debug | -
saxon-9.1.0.8.jar | 4.81 MB | 1,172 | 1,141 | 25 | 1.4 | debug | -
ant-1.8.1.jar | 1.44 MB | 924 | 873 | 30 | 1.4 | debug | -
ant-launcher-1.8.1.jar | 12.02 kB | 12 | 5 | 1 | 1.4 | debug | -
ant-testutil-1.7.1.jar | 14.59 kB | 18 | 7 | 4 | 1.2 | debug | -
commons-lang3-3.1.jar | 308.40 kB | 179 | 153 | 12 | 1.5 | debug | -
mockito-all-1.9.5.jar | 1.51 MB | 1,372 | 698 | 74 | 1.5 | debug | -
rhino-1.7R3.jar | 1.04 MB | 476 | 443 | 22 | 1.5 | debug | -
xercesImpl-2.9.1.jar | 1.17 MB | 964 | 894 | 38 | 1.1 | release | -
xmlParserAPIs-2.6.2.jar | 121.80 kB | 238 | 207 | 17 | 1.1 | release | -
xml-apis-1.3.02.jar | 189.65 kB | 341 | 301 | 25 | 1.1 | release | -
xom-1.0.jar | 106.32 kB | 108 | 96 | 6 | 1.2 | release | sealed
Total | Size | Entries | Classes | Packages | JDK Rev | Debug | Sealed
20 | 12.19 MB | 6,931 | 5,811 | 332 | 1.5 | 14 | 1
compile: 17 | compile: 9.21 MB | compile: 4,416 | compile: 4,066 | compile: 208 | - | compile: 12 | compile: 1
test: 2 | test: 1.81 MB | test: 1,551 | test: 851 | test: 86 | - | test: 2 | -
runtime: 1 | runtime: 1.17 MB | runtime: 964 | runtime: 894 | runtime: 38 | - | - | -

## Dependency Repository Locations

Repo ID | URL | Release | Snapshot
--- | --- | --- | ---
apache.snapshots | http://people.apache.org/repo/m2-snapshot-repository | - | Yes | -
sonatype-nexus-snapshots | https://oss.sonatype.org/content/repositories/snapshots | - | Yes | -
central | http://repo.maven.apache.org/maven2 | Yes | - | -

Repository locations for each of the Dependencies.

Artifact | apache.snapshots | sonatype-nexus-snapshots | central
--- | --- | --- | ---
asm:asm:jar:3.2 | - | - |
com.beust:jcommander:jar:1.27 | - | - |
commons-io:commons-io:jar:2.2 | - | - |
dom4j:dom4j:jar:1.6.1 | - | - |
jaxen:jaxen:jar:1.1.1 | - | - |
jdom:jdom:jar:1.0 | - | - |
junit:junit:jar:4.4 | - | - |
net.java.dev.javacc:javacc:jar:4.1 | - | - |
net.sourceforge.saxon:saxon:jar:dom:9.1.0.8 | - | - |
net.sourceforge.saxon:saxon:jar:9.1.0.8 | - | - |
org.apache.ant:ant:jar:1.8.1 | - | - |
org.apache.ant:ant-launcher:jar:1.8.1 | - | - |
org.apache.ant:ant-testutil:jar:1.7.1 | - | - |
org.apache.commons:commons-lang3:jar:3.1 | - | - |
org.mockito:mockito-all:jar:1.9.5 | - | - |
org.mozilla:rhino:jar:1.7R3 | - | - |
xerces:xercesImpl:jar:2.9.1 | - | - |
xerces:xmlParserAPIs:jar:2.6.2 | - | - |
xml-apis:xml-apis:jar:1.3.02 | - | - |
xom:xom:jar:1.0 | - | - |
Total | apache.snapshots | sonatype-nexus-snapshots | central
20 (compile: 17, test: 2, runtime: 1) | 0 | 0 | 20