GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • PMD Source Code Analyzer Project
  • Nav
  • Download
  • Fork us on github
  • Edit on GitHub

This view

  • Original page
  • New address

GeezerVison is showing pmd.sourceforge.io β€” Documentation Index | PMD Source Code Analyzer

 
  • PMD 7.15.0
  • Release date: 27-June-2025
  • About
    • Home
    • Release notes
    • Release notes (PMD 7)
    • Getting help
    • Release policies
    • Support lifecycle
    • Security
  • User Documentation
    • Migration Guide for PMD 7
    • Installation and basic CLI usage
    • Making rulesets
    • Configuring rules
    • Best practices
    • Suppressing warnings
    • Incremental analysis
    • PMD CLI reference
    • PMD Report formats
    • 3rd party rulesets
    • Signed Releases
    • CPD reference
      • Copy-paste detection
      • CPD Report formats
    • Extending PMD
      • Introduction to writing rules
      • Your first rule
      • XPath rules
      • Java rules
      • Rule designer reference
      • Defining rule properties
      • Rule guidelines
      • Testing your rules
      • Creating (XML) dump of the AST
    • Tools / Integrations
      • Maven PMD Plugin
      • Gradle
      • Ant
      • PMD Java API
      • bld PMD Extension
      • CI integrations
      • IDE Plugins
      • Other Tools / Integrations
  • Rule Reference
    • Apex Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Documentation
      • Error Prone
      • Performance
      • Security
    • HTML Rules
      • Index
      • Best Practices
    • Java Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Documentation
      • Error Prone
      • Multithreading
      • Performance
      • Security
    • Java Server Pages Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Error Prone
      • Security
    • JavaScript Rules
      • Index
      • Best Practices
      • Code Style
      • Error Prone
      • Performance
    • Kotlin Rules
      • Index
      • Best Practices
      • Error Prone
    • Maven POM Rules
      • Index
      • Error Prone
    • Modelica Rules
      • Index
      • Best Practices
    • PLSQL Rules
      • Index
      • Best Practices
      • Code Style
      • Design
      • Error Prone
    • Salesforce Visualforce Rules
      • Index
      • Security
    • Scala Rules
      • Index
    • Swift Rules
      • Index
      • Best Practices
      • Error Prone
    • Velocity Template Language (VTL) Rules
      • Index
      • Best Practices
      • Design
      • Error Prone
    • WSDL Rules
      • Index
    • XML Rules
      • Index
      • Best Practices
      • Error Prone
    • XSL Rules
      • Index
      • Code Style
      • Performance
  • Language-Specific Documentation
    • Overview
    • Language configuration
    • Apex
    • C/C++
    • C#
    • Coco
    • Dart
    • Fortran
    • Gherkin
    • Go
    • HTML
    • Java
    • JavaScript / TypeScript
    • JSP
    • Julia
    • Kotlin
    • Lua
    • Matlab
    • Modelica
    • Objective-C
    • Perl
    • PHP
    • PLSQL
    • Python
    • Ruby
    • Rust
    • Scala
    • Swift
    • T-SQL
    • Visualforce
    • Velocity Template Language (VTL)
    • XML and XML dialects
  • Developer Documentation
    • Contributing
      • Contributing
      • Developer resources
      • Newcomers' Guide
      • Writing documentation
    • Building PMD
      • General Info
      • Building PMD from source
      • Building PMD with IntelliJ IDEA
      • Building PMD with Eclipse IDE
      • Building PMD with VS Code IDE
      • Building PMD with Netbeans IDE
    • Roadmap
    • GitHub Actions Workflows
    • How PMD works
    • Pmdtester
    • Rule Deprecation Policy
    • Major contributions
      • Rule Guidelines
      • Adding a new dialect
      • Adding a new language (JavaCC)
      • Adding a new language (ANTLR)
      • Adding a new CPD language
    • Experimental features
      • List of experimental Features
  • Project documentation
    • Trivia about PMD
      • PMD in the press
      • Products & books related to PMD
      • Similar projects
      • What does 'PMD' mean?
    • Logo
    • FAQ
    • License
    • Credits
    • Old release notes
    • Decisions
    • Project management
      • Infrastructure
      • Release process
      • Merging pull requests
      • Main Landing page

Documentation Index

Welcome to the documentation site for PMD and CPD!

Table of Contents

πŸ’‘ Overview

PMD is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It’s mainly concerned with Java and Apex, but supports 16 other languages. It comes with 400+ built-in rules. It can be extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.

Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available.

Additionally, it includes CPD, the copy-paste-detector. CPD finds duplicated code in Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Rust, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.

PMD features many built-in checks (in PMD lingo, rules), which are documented for each language in our Rule references. We also support an extensive API to write your own rules, which you can do either in Java or as a self-contained XPath query.

PMD is most useful when integrated into your build process. It can then be used as a quality gate, to enforce a coding standard for your codebase. Among other things, PMD can be run:

  • As a Maven goal
  • As an Ant task
  • As a Gradle task
  • As a bld operation
  • From command-line

CPD, the copy-paste detector, is also distributed with PMD. You can use it in a variety of ways, which are documented here.

πŸ’Ύ Download

The latest release of PMD can be downloaded from our Github releases page.

The Logo is available from the Logo Project Page.

πŸ“– Documentation

The rest of this page exposes the contents of the documentation site thematically, which you can further scope down using the blue filter buttons. To navigate the site, you may also use the search bar in the top right, or the sidebar on the left.

✨ Contributors

This project follows the all-contributors specification. Contributions of any kind welcome!

See credits for the complete list.


Getting started

These pages summarize the gist of PMD usage to get you started quickly.

  • Installation and basic CLI usage
  • Making rulesets
  • Configuring rules
  • Introduction to writing PMD rules

Rule references

Pick your language to find out about the rule it supports.

  • 3rd party rulesets
  • Apex
  • HTML
  • Java
  • Java Server Pages
  • JavaScript
  • Kotlin
  • Maven POM
  • Modelica
  • PLSQL
  • Salesforce Visualforce
  • Scala
  • Swift
  • Velocity Template Language (VTL)
  • XML
  • XSL
Writing rules

These pages document the process of writing and testing custom rules and metrics for PMD.

  • Introduction to writing PMD rules
  • Your first rule
  • Writing XPath rules
  • Writing a custom rule
  • The rule designer
  • Defining rule properties
  • Rule guidelines
  • Testing your rules
  • Writing a custom rule

Usage and configuration

Learn how to build effective and versatile rulesets.

  • Migration Guide for PMD 7
  • Installation and basic CLI usage
  • Making rulesets
  • Configuring rules
  • Best Practices
  • Suppressing warnings
  • Incremental Analysis
  • PMD CLI reference
  • Report formats for PMD
  • 3rd party rulesets
  • Signed Releases
  • Finding duplicated code with CPD
  • Report formats for CPD
  • Creating XML dump of the AST

Contributing

If you'd like to help us build PMD, these topics may interest you. See you around!

  • Contributor's Guide
  • Developer Resources
  • Newcomers' Guide
  • Writing documentation
  • Building PMD General Info
  • Building PMD from source
  • Building PMD with IntelliJ IDEA
  • Building PMD with Eclipse
  • Building PMD with VS Code
  • Building PMD with Netbeans
  • Roadmap
  • How PMD Works
  • Pmdtester
  • Rule deprecation policy
  • Logging
Tools and integrations

These pages describe solutions that integrate PMD within your build process.

  • Maven PMD Plugin
  • Gradle
  • Ant Task Usage
  • PMD Java API
  • bld PMD Extension
  • Continuous Integrations plugins
  • IDE Plugins
  • Tools / Integrations
Major contributions

  • Guidelines for standard rules
  • Adding PMD support for a new dialect for an already existing language
  • Adding PMD support for a new JavaCC grammar based language
  • Adding PMD support for a new ANTLR grammar based language
  • How to add a new CPD language
You are visitor 01402775 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.