> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PMD

> CodeRabbit's guide to PMD.

[PMD](https://pmd.github.io/) is an extensible multilanguage static code analyzer. It's mainly concerned with Java.

## Files

PMD will run on files with the following extensions:

* `.java`
* `.jsp`
* `.kt` (Kotlin)
* `.apex` (Salesforce Apex)
* `pom.xml` (Maven)

## Configuration

PMD uses an XML configuration file when one is available. If no PMD configuration is present, CodeRabbit generates a default ruleset based on the selected review profile.

PMD supports the following config files:

* User-defined config file set at `reviews.tools.pmd.config_file` in your project's `.coderabbit.yaml` file or setting the "Reviews → Tools → PMD → Config File" field in CodeRabbit's settings page.

* If no user-defined config file is found, CodeRabbit looks for the following config file in the repo:
  * `ruleset.xml`

If neither a user-defined config file nor `ruleset.xml` is found, CodeRabbit uses its generated default ruleset.

## When we skip PMD

CodeRabbit will skip running PMD when:

* PMD is disabled in CodeRabbit settings or `.coderabbit.yaml`.
* PMD is already running in GitHub workflows.

## Links

* [PMD Configuring rules](https://pmd.github.io/pmd/pmd_userdocs_configuring_rules.html)
