PMD
pmd.github.io
What it is
PMD is a free, extensible static code analyzer that checks source code for programming flaws such as unused variables, empty catch blocks, and unnecessary object creation. It includes more than 400 built-in rules, and teams can write custom rules in Java or XPath. Its bundled CPD tool finds duplicated code across many programming languages. PMD checks source directories from the command line and can run as a Maven, Ant, Gradle, or bld build operation. Supported languages include Java, JavaScript, Salesforce Apex and Visualforce, Kotlin, Swift, Modelica, PL/SQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML, and XSL; Scala is supported without Scala rules. It runs on Linux, macOS, and Windows and requires Java 8 or above. For CI, its GitHub Action can create SARIF reports and fail builds based on violation counts; documentation also covers GitLab, Jenkins, and Bamboo integrations. IDE integrations include Eclipse, IntelliJ IDEA, and Visual Studio Code, though some listed plugins are not actively maintained. Only the latest major version is actively developed.
Spec sheet
- Purpose
- PMD is an extensible cross-language static code analyzer that finds common programming flaws.Read 2 Oct 2026 · pmd.github.io
- Support
- The project directs users to Stack Overflow for questions, GitHub issues for suspected bugs or requests, and Gitter for quick questions.Read 2 Oct 2026 · pmd.github.io
- License
- The project identifies its license as BSD-style.Read 2 Oct 2026 · pmd.github.io
- Build integrations
- PMD can be integrated through Maven or Gradle builds, which can be configured to fail when violations are found.Read 2 Oct 2026 · docs.pmd-code.org
- Built-in rules
- PMD includes more than 400 built-in rules and supports custom rules written in Java or XPath.Read 2 Oct 2026 · pmd.github.io
- CI ecosystem
- The project documents integrations for Atlassian Bamboo, GitHub Actions, GitLab and Jenkins.Read 1 Oct 2026 · pmd.github.io
- CI integration
- PMD provides a GitHub Action that runs custom rulesets, creates SARIF reports and can fail builds based on violation counts.Read 1 Oct 2026 · pmd.github.io
- Copy-paste detection
- PMD includes CPD, a copy-paste detector distributed with PMD.Read 1 Oct 2026 · pmd.github.io
- Duplicate detection
- PMD includes CPD, a copy-paste detector that finds duplicated code across many programming languages.Read 2 Oct 2026 · pmd.github.io
- GitHub Actions
- PMD's GitHub Action runs a user-supplied ruleset, creates a SARIF report, and can fail a build based on violation count.Read 2 Oct 2026 · docs.pmd-code.org
- GitLab
- PMD documents a CI/CD component to convert PMD reports into GitLab's Code Quality report format.Read 2 Oct 2026 · docs.pmd-code.org
- IDE integrations
- The project lists integrations for Eclipse, IntelliJ IDEA, and Visual Studio Code, among other IDEs.Read 2 Oct 2026 · docs.pmd-code.org
- IDE plugin status
- The IDE integration page marks some plugins as not actively maintained, including its listed Apache NetBeans and Emacs integrations.Read 2 Oct 2026 · docs.pmd-code.org
- Installation
- PMD requires Java 8 or above and is distributed as a ZIP archive containing PMD and CPD.Read 1 Oct 2026 · pmd.github.io
- Languages
- PMD focuses mainly on Java and Apex and supports 16 other languages, including JavaScript, Kotlin, Swift, and XML.Read 2 Oct 2026 · pmd.github.io
- Operating systems
- The documentation provides execution instructions for Linux/Unix and Windows, using pmd or pmd.bat.Read 1 Oct 2026 · pmd.github.io
- Other integrations
- The project lists integrations including Codacy, Codiga, Tencent Cloud Code Analysis, MegaLinter and a SonarQube PMD plugin.Read 1 Oct 2026 · pmd.github.io
- Release verification
- Since PMD 7.11.0, binary distribution files have GPG signatures for download verification.Read 1 Oct 2026 · pmd.github.io
- Rules
- PMD includes 400+ built-in rules and supports custom rules written in Java or XPath.Read 1 Oct 2026 · pmd.github.io
- Security reporting
- PMD directs security issue reports to its SECURITY.md policy.Read 1 Oct 2026 · pmd.github.io
- Support lifecycle
- Only the latest major version is in active development and regularly receives new features and bug fixes; older major versions become unsupported.Read 1 Oct 2026 · pmd.github.io
- Usage
- PMD provides a command-line interface for checking source directories against a ruleset.Read 2 Oct 2026 · pmd.github.io
Plans and prices
Strong points and limits
Strong points
- Includes more than 400 built-in rules
- Supports custom rules in Java or XPath
- Bundles CPD for duplicate-code detection
- Integrates with build tools and CI systems
Limits
- Requires Java 8 or above
- Scala support has no Scala rules
- Only the latest major version is actively developed
- Some listed IDE plugins are not actively maintained
Who it suits
PMD suits developers and teams who want static checks and duplicate-code detection in their build or CI workflows. It is a fit for users able to run Java 8 or above and select rules for their supported languages.
Verdict
PMD offers multilingual static analysis with customizable rules and a bundled duplicate-code detector. Check language coverage and plugin maintenance status against your workflow before adopting it.
Where Specifiction places it
- Code Clone Detection Tools#3 of 238.1
- Linters#6 of 338.3
- Code Duplication Detection Tools#4 of 188.1
- Code Complexity Analyzers#6 of 188.3
- Static Analysis Tools#13 of 388.2