Coding

PMD – extensible cross-language static code analyser

PMD is an extensible static code analyser that detects programming mistakes, code smells and potentially inefficient constructs. Although particularly well known for its Java analysis capabilities, it supports a wide range of programming and markup languages.

The software examines source files using language-specific parsers and abstract syntax trees. Its rules can identify problems such as unused variables, empty exception handlers, unnecessarily complicated expressions and questionable coding practices.

PMD is designed to be adaptable to different coding standards and development workflows. Developers can select existing rules, configure their behaviour or create their own checks. It also includes CPD, a separate component for detecting duplicated source code across files and projects.

This is free and open source software.

Key Features

  • Static source code analysis using hundreds of built-in rules covering correctness, maintainability and coding practices.
  • Supports Java, Apex, JavaScript, Kotlin, XML and numerous other languages.
  • Detects unused variables, empty catch blocks, unnecessary object creation and other common programming flaws.
  • Analyses source code using abstract syntax trees produced by language-specific parsers.
  • Configurable rulesets allow individual checks to be enabled, disabled or customised.
  • Supports custom analysis rules written in Java or expressed as XPath queries.
  • Includes CPD, a copy-paste detector that identifies duplicated code fragments across numerous programming languages.
  • Supports multiple reporting formats, including text, XML and other machine-readable representations.
  • Command-line interface for analysing files and directories.
  • Provides integrations with Maven, Gradle and development environments.
  • Allows auxiliary classpath information to improve analysis of Java source code.
  • Can be incorporated into automated build and continuous integration workflows.
  • Cross-platform support – runs on Linux, macOS, and Windows.

Website: github.com/pmd/pmd
Support:
Developer: InfoEther, LLC
License: BSD-style License

PMD is written in Java. Learn Java with our recommended free books and free tutorials.


Related Software

Java Linter Tools
SpotBugsFind bugs in Java code
PMDExtensible cross-language static code analyzer
Error ProneCatch common Java mistakes
NullAwayEliminate NPEs in Java code
InferStatic analysis tool for Java, C++, Objective-C, and C
CheckstyleWrite Java code that adheres to a coding standard
Checker FrameworkPluggable type-checking for Java
OpenRewriteAutomates large-scale source code refactoring and migration
Find Security BugsDetects security vulnerabilities in Java applications
Forbidden APIsChecks Java code for prohibited or unsafe API usage

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted