• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Review Bot 4.x
    2. Version 4.x
    3. Version 3.0
    4. Version 2.0
    5. Version 1.0
    6. Review Bot Tools
    7. PMD
  • Home
  • Installation
  • Manually Installing Review Bot
  • Review Bot Docker Images
  • Upgrading Review Bot
  • Configuring Review Bot
  • Review Bot Tools
  • Cargo Tool
  • Checkstyle
  • Clang Static Analyzer
  • Cppcheck
  • Cpplint
  • Doc8
  • FBInfer
  • Flake8
  • Go Fmt
  • Go Tool
  • JSHint
  • PMD
  • Pycodestyle
  • Pydocstyle
  • Pyflakes
  • RuboCop
  • Rust Fmt
  • Secret Scanner
  • ShellCheck
  • Module and Class Reference
  • reviewbot.tools.base
  • reviewbot.tools.base.mixins
  • reviewbot.tools.base.registry
  • reviewbot.tools.base.tool
  • reviewbot.testing.testcases
  • reviewbot.testing.utils
  • reviewbot.tools.testing
  • reviewbot.tools.testing.decorators
  • reviewbot.tools.testing.testcases
  • reviewbot.processing.review
  • reviewbot.utils.api
  • reviewbot.utils.filesystem
  • reviewbot.utils.log
  • reviewbot.utils.process
  • reviewbot.utils.text
  • reviewbot.celery
  • reviewbot.config
  • reviewbot.deprecation
  • reviewbot.errors
  • reviewbot.repositories
  • reviewbot.tasks
  • reviewbot.tools.cargotool
  • reviewbot.tools.checkstyle
  • reviewbot.tools.clang
  • reviewbot.tools.cppcheck
  • reviewbot.tools.cpplint
  • reviewbot.tools.doc8
  • reviewbot.tools.fbinfer
  • reviewbot.tools.flake8
  • reviewbot.tools.gofmt
  • reviewbot.tools.gotool
  • reviewbot.tools.jshint
  • reviewbot.tools.pmd
  • reviewbot.tools.pycodestyle
  • reviewbot.tools.pydocstyle
  • reviewbot.tools.pyflakes
  • reviewbot.tools.rbsecretscanner
  • reviewbot.tools.rubocop
  • reviewbot.tools.rustfmt
  • reviewbot.tools.shellcheck
  • General Index
  • Python Module Index
  • Release Notes
  • PMD¶

    PMD is a static analysis tool that provides a variety of checkers for many languages.

    Supported Versions¶

    Review Bot supports both the 6.x and 7.x major versions of PMD.

    Supported File Types¶

    The following are supported by this tool:

    • Apex: *.cls

    • C/C++: *.c, *.cc, *.cpp, *.cxx, *.C, *.h, *.hpp, *.hxx

    • C#: *.cs

    • Dart: *.dart

    • Fortran: *.f, *.f66, *.f77, *.f90, *.for

    • Go: *.go

    • Groovy: *.groovy

    • Java: *.java

    • JavaScript: *.js

    • Java Server Pages: *.jsp, *.jspf, *.jspx, *.tag

    • Kotlin: *.kt

    • Lua: *.lua

    • Matlab: *.m

    • Modelica: *.mo

    • Objective-C: *.h, *.m

    • Perl: *.plm, *.pm, *.t

    • PHP: *.class, *.php

    • PL/SQL: *.fnc, *.pkb, *.pkh, *.pks, *.plb, *.pld, *.plh, *.pls, *.prc, *.sql, *.tpb, *.tps, *.trg, *.tyb, *.typ

    • Python: *.py

    • Ruby: *.cgi, *.class, *.rb

    • Scala: *.scala

    • Swift: *.swift

    • VisualForce: *.component, *.page

    • VM: *.vm

    • XML: *.xml

    It may also scan other file extensions to see if they appear to be one of the languages above.

    PMD can be configured to match only specific file types.

    Installation¶

    PMD can be installed through many system package managers, or downloaded and installed manually.

    Configuration¶

    PMD Location¶

    Because there are a variety of methods to install PMD, there’s no consistent location (or name) of the PMD executable. If installed through a package manager, it can often be invoked via pmd. If installed manually, it’s invoked via run.sh.

    If it’s not named pmd, or can’t be found in Review Bot’s PATH environment variable, then you’ll need to specify the path in the Review Bot worker config file:

    exe_paths = {
        'pmd': '/path/to/pmd',
    }
    

    You will need to restart the Review Bot worker after making this change.

    Note

    This setting was renamed in Review Bot 3.0.

    In Review Bot 2.0, this setting was called pmd_path. For consistency, the old setting was deprecated in 3.0, and will be removed in 4.0.

    See Review Bot 3.0 Configuration Changes.

    Enabling PMD in Review Board¶

    First, you’ll need to add a Review Bot configuration in Review Board (see Tool Configurations).

    The following configuration options are available:

    Rulesets (required):

    This can be one of the following:

    1. A comma-separated list of PMD rulesets to apply (equivalent to pmd -rulesets ...).

    2. A full PMD ruleset configuration file (starting with <?xml ...?>).

    Scan files (optional):

    A comma-separated list of file extensions to scan. Only files in the diff that match these file extensions will trigger the PMD configuration.

    If not provided, the tool will be ran for all files in the diff.

    For example: c,js,py

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • Supported Versions
    • Supported File Types
    • Installation
    • Configuration
      • PMD Location
      • Enabling PMD in Review Board