FREEDOM251

Freedom251 › Code Complexity Analyzers

PMD

Free plan LinuxMacSelf-hostedWindows

Visit PMD Alternatives Pricing

PMD's own site

What PMD is

PMD is a free static code analyzer for finding programming flaws across many languages. It checks source directories against a ruleset and includes more than 400 built-in rules for issues such as unused variables, empty catch blocks, and unnecessary object creation. Teams can add their own rules in Java or XPath. Its bundled CPD tool finds duplicated code. PMD supports 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 can run from the command line or as a Maven, Ant, Gradle, or bld build operation. PMD runs on Linux, macOS, and Windows and requires Java 8 or above. It also offers a GitHub Action that creates SARIF reports and can fail builds based on violation counts. IDE integrations include Eclipse, IntelliJ IDEA, and Visual Studio Code, although some listed plugins are not actively maintained. Only the latest major version is actively developed.

Who it suits

PMD suits developers and teams who want configurable static analysis and duplicate-code detection in their development or build workflow. Its language coverage and CI integrations may fit projects using the listed languages and tools.

What it does well

  • Free, with more than 400 built-in rules.
  • Custom rules can be written in Java or XPath.
  • Bundled CPD detects duplicated code.
  • Runs through several build tools and CI integrations.

What to know first

  • 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.

Plans

PlanBilled and limitsPrice
PMDBSD-style license · downloadable static code analyzerFree

As pmd.github.io lists them, read 2 Oct 2026. The maker's own page has the final word.

Getting started

  1. Download the PMD and CPD ZIP archive from the PMD website.
  2. Install Java 8 or above.
  3. Run PMD from the command line against source directories and a ruleset, or use a supported build operation.
  4. Connect it to a documented CI integration or IDE if that fits your workflow.

Overview

PMD is a free static code analyzer for developers and teams who want to check code across multiple languages. It is a particularly good fit when configurable rules and duplicate-code detection matter; it is less compelling for teams that need uniform rule coverage across every supported language.

Its BSD-style license and downloadable distribution keep adoption straightforward, but running it requires Java 8 or above. Teams should also account for its version policy: only the latest major version remains in active development and regularly receives fixes and new features.

Key features

PMD includes more than 400 built-in rules for issues such as unused variables, empty catch blocks and unnecessary object creation. Custom rules written in Java or XPath let teams adapt checks to local conventions, a meaningful advantage over a fixed ruleset. That flexibility suits teams willing to select and maintain their rules; it may be more setup than a project seeking a ready-made, uniform policy needs.

Its language list includes 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, so teams should not assume equivalent analysis depth across the full range. CPD, bundled with PMD, detects duplicated code across many programming languages and makes the download useful for teams that want clone detection alongside static analysis.

PMD runs from the command line or as a Maven, Ant, Gradle or bld build operation. Its GitHub Action uses a supplied ruleset, creates SARIF reports and can fail a build at a chosen violation count. PMD also documents CI integrations for Atlassian Bamboo, GitHub Actions, GitLab and Jenkins; its GitLab component converts PMD reports to GitLab's Code Quality format. This supports automated checks, while the ruleset still needs to reflect the project's needs.

IDE integrations include Eclipse, IntelliJ IDEA and Visual Studio Code, among others. Some integrations, including the listed Apache NetBeans and Emacs plugins, are marked as not actively maintained, so teams relying on those editors should weigh that maintenance status before standardizing on them.

Pricing

PMD costs nothing under a BSD-style license. The free plan is the downloadable static code analyzer, with no separate paid tier described. There is no free trial because the software is free; no seat or usage quota is stated.

Platforms

PMD supports Linux, macOS, Windows and self-hosted use. It is distributed as a ZIP archive containing PMD and CPD, and requires Java 8 or above. Execution instructions cover Linux/Unix and Windows, using pmd or pmd.bat. Since version 7.11.0, binary distribution files include GPG signatures for download verification.

Who it's for

PMD suits developers and teams that want configurable static checks, broad language coverage and duplicate detection without a software charge. Its build-tool and CI options make it a sensible choice for projects that want to include checks in development or build workflows. It is a weaker fit when Scala-specific rules are essential, Java cannot be part of the runtime environment, or a team depends on an IDE plugin that is not actively maintained.

Questions can be raised through Stack Overflow, GitHub Discussions, Gitter or PMD Guru at Gurubase; bugs can be reported through GitHub issues. Security reports follow PMD's SECURITY.md policy.

Pros and cons

  • Pros: More than 400 built-in rules plus Java- and XPath-based custom rules give teams room to align checks with their conventions.
  • Pros: CPD adds duplicate-code detection in the same distribution, avoiding a separate tool for that task.
  • Pros: Command-line, build-tool and CI integrations support use in both local and automated workflows.
  • Cons: Java 8 or above is required to run PMD, which adds a runtime requirement for teams not already using Java.
  • Cons: Scala has no Scala-specific rules, and some IDE integrations are not actively maintained, limiting confidence in coverage or editor support for those users.
  • Cons: Older major versions become unsupported, so teams need to keep current to receive active development and regular fixes.

Alternatives

For a narrower focus on code clones, compare Code Clone Detection Tools. Readers choosing primarily among general code-quality checks can browse Linters or Static Analysis Tools.

Duplo is another free option for Linux, macOS and Windows, distributed under GNU GPL v2 or later. CloneWorks is free on those platforms, but its license requires acknowledgement and requires redistribution and derivatives to remain free of charge. dcd is free for Linux and macOS under AGPL-3.0; it also offers priority direct email support for a price not listed.

jscpd is another free option, with API, Linux, macOS, self-hosted and Windows platforms. NiCad is free, MIT-licensed and requires OpenTxl 11 or later. Simian Similarity Analyzer is a free option for Linux, macOS and Windows under Apache License 2.0. copydetect is free and supports API, Linux, macOS, self-hosted and Windows platforms. Algo VPN is also listed as free and supports Android, iOS, Linux, macOS and Windows.

Verdict

Choose PMD if your team wants a free, extensible analyzer that combines a substantial built-in ruleset with bundled duplicate detection and can be integrated into build or CI workflows. Look elsewhere if Java 8 or above is impractical, Scala rule coverage is central, or your workflow depends on an IDE integration that is no longer actively maintained.

Verdict

PMD combines broad language coverage, custom rules, and bundled duplicate detection without a listed price. Check language-specific rule coverage and version support before adopting it.

Questions

How much does PMD cost?

PMD is free. Its plan is listed as free under a BSD-style license.

Which languages does PMD support?

It supports 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.

Can teams create custom rules?

Yes. Custom rules can be written in Java or XPath.

What does PMD need to run?

PMD requires Java 8 or later and is distributed as a ZIP archive containing PMD and CPD.

Does PMD work with CI and IDEs?

The project documents CI integrations including GitHub Actions, GitLab, Jenkins, and Atlassian Bamboo, and IDE integrations including Eclipse, IntelliJ IDEA, and Visual Studio Code.

Is PMD open source?

The PMD repository identifies its license as BSD Style.

Facts from PMD's own pages

Build integrations
PMD can be integrated through Maven or Gradle builds, which can be configured to fail when violations are found. · docs.pmd-code.org, 2 Oct 2026
Built-in rules
PMD includes more than 400 built-in rules and supports custom rules written in Java or XPath. · pmd.github.io, 2 Oct 2026
CI ecosystem
The project documents integrations for Atlassian Bamboo, GitHub Actions, GitLab and Jenkins. · pmd.github.io, 1 Oct 2026
CI integration
PMD provides a GitHub Action that runs custom rulesets, creates SARIF reports and can fail builds based on violation counts. · pmd.github.io, 1 Oct 2026
Copy-paste detection
PMD includes CPD, a copy-paste detector distributed with PMD. · pmd.github.io, 1 Oct 2026
Duplicate detection
PMD includes CPD, a copy-paste detector that finds duplicated code across many programming languages. · pmd.github.io, 2 Oct 2026
GitHub Actions
PMD's GitHub Action runs a user-supplied ruleset, creates a SARIF report, and can fail a build based on violation count. · docs.pmd-code.org, 2 Oct 2026
GitLab
PMD documents a CI/CD component to convert PMD reports into GitLab's Code Quality report format. · docs.pmd-code.org, 2 Oct 2026
IDE integrations
The project lists integrations for Eclipse, IntelliJ IDEA, and Visual Studio Code, among other IDEs. · docs.pmd-code.org, 2 Oct 2026
IDE plugin status
The IDE integration page marks some plugins as not actively maintained, including its listed Apache NetBeans and Emacs integrations. · docs.pmd-code.org, 2 Oct 2026
Installation
PMD requires Java 8 or above and is distributed as a ZIP archive containing PMD and CPD. · pmd.github.io, 1 Oct 2026
Languages
PMD focuses mainly on Java and Apex and supports 16 other languages, including JavaScript, Kotlin, Swift, and XML. · pmd.github.io, 2 Oct 2026
License
The project identifies its license as BSD-style. · pmd.github.io, 2 Oct 2026
Operating systems
The documentation provides execution instructions for Linux/Unix and Windows, using pmd or pmd.bat. · pmd.github.io, 1 Oct 2026
Other integrations
The project lists integrations including Codacy, Codiga, Tencent Cloud Code Analysis, MegaLinter and a SonarQube PMD plugin. · pmd.github.io, 1 Oct 2026
Purpose
PMD is an extensible cross-language static code analyzer that finds common programming flaws. · pmd.github.io, 2 Oct 2026
Release verification
Since PMD 7.11.0, binary distribution files have GPG signatures for download verification. · pmd.github.io, 1 Oct 2026
Rules
PMD includes 400+ built-in rules and supports custom rules written in Java or XPath. · pmd.github.io, 1 Oct 2026
Security reporting
PMD directs security issue reports to its SECURITY.md policy. · pmd.github.io, 1 Oct 2026
Support
The project directs users to Stack Overflow for questions, GitHub issues for suspected bugs or requests, and Gitter for quick questions. · pmd.github.io, 2 Oct 2026
Support lifecycle
Only the latest major version is in active development and regularly receives new features and bug fixes; older major versions become unsupported. · pmd.github.io, 1 Oct 2026
Usage
PMD provides a command-line interface for checking source directories against a ruleset. · pmd.github.io, 2 Oct 2026

Where PMD stands on Freedom251

Look at these too