2016-09-07 16:10:48 -04:00
|
|
|
---
|
2018-05-24 17:23:44 +02:00
|
|
|
title: Documentation Index
|
2016-09-07 22:17:39 -04:00
|
|
|
keywords: java
|
2016-09-07 16:10:48 -04:00
|
|
|
permalink: index.html
|
2017-08-18 10:33:43 +02:00
|
|
|
toc: false
|
|
|
|
summary: >
|
2018-05-27 19:55:42 +02:00
|
|
|
Welcome to the documentation site for PMD and CPD! <br/><br/>
|
|
|
|
|
|
|
|
|
2017-08-18 10:33:43 +02:00
|
|
|
last_updated: August 2017
|
2018-05-23 15:55:51 +02:00
|
|
|
author: Jeff Jensen <jjensen@apache.org>, Andreas Dangel <andreas.dangel@adangel.org>,
|
|
|
|
Clément Fournier <clement.fournier76@gmail.com>
|
2016-09-07 16:10:48 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
|
2018-05-20 09:27:36 +02:00
|
|
|
|
2018-05-21 08:30:37 +02:00
|
|
|
{% unless site.output == "pdf" %}
|
|
|
|
<script src="js/jquery.shuffle.min.js"></script>
|
|
|
|
<script src="js/jquery.ba-throttle-debounce.min.js"></script>
|
2018-05-27 19:55:42 +02:00
|
|
|
|
|
|
|
{% include custom/panel_scroll.html %}
|
2018-05-21 08:30:37 +02:00
|
|
|
{% endunless %}
|
|
|
|
|
2018-05-21 16:49:12 +02:00
|
|
|
|
2018-05-27 19:55:42 +02:00
|
|
|
## Overview
|
|
|
|
|
|
|
|
<!-- You can link to an individual panel, the id is determined from the title of the panel -->
|
|
|
|
<!-- See custom/shuffle_panel.html for the details -->
|
|
|
|
|
|
|
|
**PMD** is a static source code analyzer. It finds common programming flaws like
|
|
|
|
unused variables, empty catch blocks, unnecessary object creation, and
|
|
|
|
so forth. It's mainly concerned with **Java and Apex**, but **supports six other
|
|
|
|
languages**.
|
|
|
|
|
|
|
|
PMD features many **built-in checks** (in PMD lingo, *rules*), which are documented
|
|
|
|
for each language in our [Rule references](#shuffle-panel-rule-references). We
|
|
|
|
also support an extensive API to [**write your own rules**](#shuffle-panel-writing-rules),
|
|
|
|
which you can do either in Java or as a self-contained XPath query.
|
|
|
|
|
|
|
|
PMD is most useful when **integrated into your build process**. It can then be
|
|
|
|
used as a quality gate, to enforce a coding standard for your codebase. PMD
|
|
|
|
can be used:
|
|
|
|
* As a [Maven goal](pmd_userdocs_tools_maven.html)
|
|
|
|
* As an [Ant task](pmd_userdocs_tools_ant.html)
|
|
|
|
* As a [Gradle task](https://docs.gradle.org/current/userguide/pmd_plugin.html)
|
|
|
|
* From [command-line](pmd_userdocs_installation.html#running-pmd-via-command-line)
|
|
|
|
|
|
|
|
**CPD**, the **copy-paste detector**, is also distributed with PMD. You can also use it
|
|
|
|
in a variety of ways, which are [documented here](pmd_userdocs_cpd.html).
|
|
|
|
|
|
|
|
## Download
|
|
|
|
|
|
|
|
The latest release of PMD can be downloaded from our [Github releases page](https://github.com/pmd/pmd/releases/latest).
|
|
|
|
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
The rest of this page exposes the contents of the documentation site thematically,
|
|
|
|
which you can further scope down using the blue filter buttons. To navigate the site,
|
|
|
|
you may also use the search bar in the top right, or the sidebar on the left.
|
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-21 16:49:12 +02:00
|
|
|
|
2018-05-23 15:55:51 +02:00
|
|
|
<div class="filter-options" id='grid-rule' >
|
2018-05-21 08:30:37 +02:00
|
|
|
<button class="btn btn-primary" data-group="all">All</button>
|
|
|
|
<button class="btn btn-primary" data-group="getting_started">Getting Started</button>
|
|
|
|
<button class="btn btn-primary" data-group="userdocs">User documentation</button>
|
|
|
|
<button class="btn btn-primary" data-group="extending">Extending PMD</button>
|
|
|
|
<button class="btn btn-primary" data-group="contributing">Contributing</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2018-05-21 16:49:12 +02:00
|
|
|
|
2018-05-23 15:55:51 +02:00
|
|
|
<div class="container-fluid" >
|
2018-05-21 01:02:58 +02:00
|
|
|
<div id="grid" class="row">
|
2018-05-20 09:27:36 +02:00
|
|
|
|
2018-05-23 15:55:51 +02:00
|
|
|
<!-- TODO the "getting started" panel is not that useful. It would be better to make a page series. -->
|
2018-05-21 01:02:58 +02:00
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Getting started"
|
2018-05-21 08:30:37 +02:00
|
|
|
tags="getting_started"
|
|
|
|
datagroups='["getting_started"]'
|
2018-05-27 19:55:42 +02:00
|
|
|
description="These pages summarize the gist of PMD usage to get you started quickly." %}
|
2018-05-20 09:27:36 +02:00
|
|
|
|
2018-05-20 21:38:54 +02:00
|
|
|
|
2018-05-21 01:02:58 +02:00
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Rule references"
|
2018-05-21 08:30:37 +02:00
|
|
|
tags="rule_references"
|
|
|
|
datagroups='["userdocs"]'
|
|
|
|
description="Pick your language to find out about the rule it supports."
|
2018-05-21 01:02:58 +02:00
|
|
|
image="fa-database"
|
|
|
|
titlemaker="page.language_name" %}
|
2018-05-20 21:38:54 +02:00
|
|
|
|
2018-05-21 08:30:37 +02:00
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Writing rules"
|
2018-05-21 08:30:37 +02:00
|
|
|
tags="userdocs,extending"
|
2018-05-21 11:52:05 +02:00
|
|
|
datagroups='["userdocs", "extending", "contributing"]'
|
2018-05-21 08:30:37 +02:00
|
|
|
description="These pages document the process of writing and testing custom rules and metrics for PMD."
|
|
|
|
%}
|
2018-05-20 21:38:54 +02:00
|
|
|
|
2018-05-21 11:52:05 +02:00
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Usage and configuration"
|
2018-05-21 11:52:05 +02:00
|
|
|
tags="userdocs"
|
|
|
|
except_tags="extending,tools"
|
|
|
|
datagroups='["userdocs"]'
|
|
|
|
image="fa-cog"
|
|
|
|
description="Learn how to build effective and versatile rulesets."
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Contributing"
|
2018-05-21 11:52:05 +02:00
|
|
|
tags="devdocs"
|
|
|
|
except_tags="extending"
|
|
|
|
datagroups='["contributing"]'
|
|
|
|
image="fa-github"
|
|
|
|
description="If you'd like to help us build PMD, these topics may interest you. See you around!"
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Tools and integrations"
|
2018-05-21 11:52:05 +02:00
|
|
|
tags="tools"
|
|
|
|
datagroups='["userdocs"]'
|
|
|
|
description="These pages describe solutions that integrate PMD within your build process."
|
|
|
|
%}
|
|
|
|
|
|
|
|
{% include custom/shuffle_panel.html
|
2018-05-27 19:55:42 +02:00
|
|
|
title="Major contributions"
|
2018-05-21 11:52:05 +02:00
|
|
|
tags="devdocs,extending"
|
|
|
|
datagroups='["contributing","extending"]'
|
|
|
|
description=""
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
2018-05-22 17:12:28 +02:00
|
|
|
<!-- sizer -->
|
|
|
|
<div class="col-xs-6 col-sm-4 col-md-1 shuffle_sizer"></div>
|
|
|
|
|
2018-05-23 15:55:51 +02:00
|
|
|
</div>
|
2018-05-21 08:30:37 +02:00
|
|
|
</div>
|
2018-05-20 09:27:36 +02:00
|
|
|
|
|
|
|
<!-- {% include image.html file="pmd-logo-big.png" alt="PMD Logo" %} -->
|
2016-09-07 16:10:48 -04:00
|
|
|
|
2018-05-21 08:30:37 +02:00
|
|
|
{% unless site.output == "pdf" %}
|
|
|
|
|
2018-05-22 17:09:26 +02:00
|
|
|
{% include initialize_shuffle.html %}
|
2018-05-21 08:30:37 +02:00
|
|
|
|
|
|
|
{% endunless %}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-07 16:10:48 -04:00
|
|
|
{% include links.html %}
|