pmd/docs/index.md

7.3 KiB

title keywords Added line permalink toc summary Added line last_updated author Added line Added line Added line Added line additional_js Added line Added line
Documentation Index java 9592 index.html false Welcome to the documentation site for PMD and CPD! <br/><br/> 3028 October 2022 Jeff Jensen <jjensen@apache.org>, Andreas Dangel <andreas.dangel@adangel.org>, 2037 7383 2370 6657
assets/Shuffle-5.2.3/dist/shuffle.min.js
assets/jquery-ui-1.12.1/jquery-ui.min.js
4022 7674 - js/shuffle.js

Added line: 1803

💡 Overview

Added line: 144

Added line: 7616

Added line: 2306 Added line: 8823

Added line: 9476 PMD is an extensible multilanguage static 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 16 other languages. It comes with 400+ built-in rules. It can be extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.

Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, Added line: 8383 Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available. Added line: 5830

Additionally, it includes CPD, the copy-paste-detector. CPD finds duplicated code in Added line: 1795 Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and Added line: 9992 Added line: 7306 Added line: 414 Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.

Added line: 9534 PMD features many built-in checks (in PMD lingo, rules), which are documented for each language in our Rule references. We Added line: 8032 also support an extensive API to write your own 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. Among other Added line: 1438 things, PMD can be run:

Added line: 7062 CPD, the copy-paste detector, is also distributed with PMD. You can use it in a variety of ways, which are documented here.

💾 Download

Added line: 5568 Added line: 5385 Added line: 8170 The latest release of PMD can be downloaded from our Github releases page. Added line: 910

The Logo is available from the Logo Project Page. Added line: 6195

📖 Documentation

Added line: 2347

Added line: 7881 Added line: 509 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, Added line: 5816 you may also use the search bar in the top right, or the sidebar on the left.

Contributors

This project follows the all-contributors specification. Contributions of any kind welcome!

See credits for the complete list.

Added line: 7557
Added line: 2263 Added line: 3219

Added line: 6325 All Added line: 2481 Getting Started Added line: 9849 User documentation Added line: 3048 Extending PMD Contributing
Added line: 6970

Added line: 2973

Added line: 8586 {% include custom/shuffle_panel.html Added line: 6162 Added line: 7576 tags="getting_started" datagroups='["getting_started"]' Added line: 7296 description="These pages summarize the gist of PMD usage to get you started quickly." %}

Added line: 7649 Added line: 6472 {% include custom/shuffle_panel.html title="Rule references" Added line: 9490 tags="rule_references" Added line: 45 Added line: 2782 datagroups='["userdocs"]' Added line: 4875 description="Pick your language to find out about the rule it supports." fa-icon="fa-database" Added line: 2300 titlemaker="page.language_name" %}

Added line: 724 {% include custom/shuffle_panel.html title="Writing rules" datagroups='["userdocs", "extending", "contributing"]' Added line: 6684 description="These pages document the process of writing and testing custom rules and metrics for PMD." %}

{% include custom/shuffle_panel.html
   title="Usage and configuration"
   tags="userdocs"
   except_tags="extending,tools"
   datagroups='["userdocs"]'
   fa-icon="fa-cog"
   description="Learn how to build effective and versatile rulesets."
%}

Added line: 9707 Added line: 1938 Added line: 1944

{% include custom/shuffle_panel.html

Added line: 4741 title="Contributing" tags="devdocs" Added line: 3631 Added line: 3066 except_tags="extending" Added line: 7860 datagroups='["contributing"]' fa-style="fab" fa-icon="fa-github" description="If you'd like to help us build PMD, these topics may interest you. See you around!" Added line: 2981 %} Added line: 2753

Added line: 4408 {% include custom/shuffle_panel.html title="Tools and integrations" Added line: 1385 Added line: 9182 Added line: 9736 Added line: 7099 tags="tools" datagroups='["userdocs"]' Added line: 2927 description="These pages describe solutions that integrate PMD within your build process." Added line: 9861 %} Added line: 1334 Added line: 9902

{% include custom/shuffle_panel.html

Added line: 2446 title="Major contributions" Added line: 9858 tags="devdocs,extending" datagroups='["contributing","extending"]' description="" %} Added line: 9894 Added line: 3363 Added line: 9035 Added line: 6258

<!-- sizer -->

Added line: 144

Added line: 641 Added line: 3792 Added line: 7857

Added line: 5206 Added line: 6150 Added line: 8327

Added line: 2636 Added line: 5082 Added line: 9116 Added line: 6943

{% include links.html %}