2075 lines
62 KiB
HTML
2075 lines
62 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<meta name="description" content="">
|
||
<meta name="keywords" content="userdocstools, ">
|
||
<title>Tools / Integrations | PMD Source Code Analyzer</title>
|
||
<link rel="stylesheet" href="css/syntax.css">
|
||
|
||
|
||
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
||
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
|
||
<link rel="stylesheet" href="css/modern-business.css">
|
||
<link rel="stylesheet" href="css/lavish-bootstrap.css">
|
||
<link rel="stylesheet" href="css/customstyles.css">
|
||
<link rel="stylesheet" href="css/theme-blue.css">
|
||
<link rel="stylesheet" href="css/pmd-customstyles.css">
|
||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||
<script src="js/jquery.navgoco.min.js"></script>
|
||
|
||
|
||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js"></script>
|
||
<script src="js/toc.js"></script>
|
||
<script src="js/customscripts.js"></script>
|
||
|
||
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
|
||
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
|
||
|
||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||
<!--[if lt IE 9]>
|
||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||
<![endif]-->
|
||
|
||
<link rel="alternate" type="application/rss+xml" title="" href="https://pmd.github.io/pmd/feed.xml">
|
||
|
||
<script>
|
||
$(document).ready(function() {
|
||
// Initialize navgoco with default options
|
||
$("#mysidebar").navgoco({
|
||
caretHtml: '',
|
||
accordion: true,
|
||
openClass: 'active', // open
|
||
save: false, // leave false or nav highlighting doesn't work right
|
||
cookie: {
|
||
name: 'navgoco',
|
||
expires: false,
|
||
path: '/'
|
||
},
|
||
slide: {
|
||
duration: 400,
|
||
easing: 'swing'
|
||
}
|
||
});
|
||
|
||
$("#collapseAll").click(function(e) {
|
||
e.preventDefault();
|
||
$("#mysidebar").navgoco('toggle', false);
|
||
});
|
||
|
||
$("#expandAll").click(function(e) {
|
||
e.preventDefault();
|
||
$("#mysidebar").navgoco('toggle', true);
|
||
});
|
||
|
||
});
|
||
|
||
</script>
|
||
<script>
|
||
$(function () {
|
||
$('[data-toggle="tooltip"]').tooltip()
|
||
})
|
||
</script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
$("#tg-sb-link").click(function() {
|
||
$("#tg-sb-sidebar").toggle();
|
||
$("#tg-sb-content").toggleClass('col-md-9');
|
||
$("#tg-sb-content").toggleClass('col-md-12');
|
||
$("#tg-sb-icon").toggleClass('fa-toggle-on');
|
||
$("#tg-sb-icon").toggleClass('fa-toggle-off');
|
||
});
|
||
});
|
||
</script>
|
||
|
||
|
||
</head>
|
||
<body>
|
||
<!-- Content is offset by the height of the topnav bar. -->
|
||
<!-- There's already a padding-top rule in modern-business.css, but it apparently doesn't work on Firefox 60 and Chrome 67 -->
|
||
<div id="topbar-content-offset">
|
||
<!-- Navigation -->
|
||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||
<div class="container topnavlinks">
|
||
<div class="navbar-header">
|
||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||
<span class="sr-only">Toggle navigation</span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
</button>
|
||
<a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> PMD Source Code Analyzer Project</span></a>
|
||
</div>
|
||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||
<ul class="nav navbar-nav navbar-right">
|
||
<!-- toggle sidebar button -->
|
||
<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>
|
||
<!-- entries without drop-downs appear here -->
|
||
|
||
|
||
|
||
<li><a href="https://github.com/pmd/pmd/releases/latest" target="_blank">Download</a></li>
|
||
|
||
|
||
|
||
<li><a href="https://github.com/pmd/pmd" target="_blank">Fork us on github</a></li>
|
||
|
||
|
||
|
||
<!-- entries with drop-downs appear here -->
|
||
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
|
||
|
||
|
||
<!--comment out this block if you want to hide search-->
|
||
<li>
|
||
<!--start search-->
|
||
<div id="search-demo-container">
|
||
<input type="text" id="search-input" placeholder="search...">
|
||
<ul id="results-container"></ul>
|
||
</div>
|
||
<script src="js/jekyll-search.js" type="text/javascript"></script>
|
||
<script type="text/javascript">
|
||
SimpleJekyllSearch.init({
|
||
searchInput: document.getElementById('search-input'),
|
||
resultsContainer: document.getElementById('results-container'),
|
||
dataSource: 'search.json',
|
||
searchResultTemplate: '<li><a href="{url}" title="Tools / Integrations">{title}</a></li>',
|
||
noResultsText: 'No results found.',
|
||
limit: 10,
|
||
fuzzy: true,
|
||
})
|
||
</script>
|
||
<!--end search-->
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<!-- /.container -->
|
||
</nav>
|
||
|
||
<!-- Page Content -->
|
||
<div class="container-toc-wrapper">
|
||
<div class="container">
|
||
<div class="col-lg-12"> </div>
|
||
<!-- Content Row -->
|
||
<div class="row">
|
||
|
||
|
||
<!-- Sidebar Column -->
|
||
<div class="col-md-3" id="tg-sb-sidebar">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<ul id="mysidebar" class="nav">
|
||
<li class="sidebarTitle">PMD 6.50.0-SNAPSHOT</li>
|
||
<div class="sidebarTitleDate">Release date: 30-September-2022</div>
|
||
|
||
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">About</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="index.html">Home</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_release_notes.html">Release notes</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_next_major_development.html">PMD 7.0.0 development</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_about_help.html">Getting help</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">User Documentation</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_installation.html">Installation and basic CLI usage</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_making_rulesets.html">Making rulesets</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_configuring_rules.html">Configuring rules</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_best_practices.html">Best practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_suppressing_warnings.html">Suppressing warnings</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_incremental_analysis.html">Incremental analysis</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_cli_reference.html">PMD CLI reference</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_report_formats.html">PMD Report formats</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">CPD reference</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_cpd.html">Copy-paste detection</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_cpd_report_formats.html">CPD Report formats</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Extending PMD</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_writing_rules_intro.html">Introduction to writing rules</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_your_first_rule.html">Your first rule</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_writing_xpath_rules.html">XPath rules</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_writing_java_rules.html">Java rules</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_designer_reference.html">Rule designer reference</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_defining_properties.html">Defining rule properties</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_metrics_howto.html">Using and defining code metrics</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_rule_guidelines.html">Rule guidelines</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_extending_testing.html">Testing your rules</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Tools / Integrations</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_tools_maven.html">Maven PMD Plugin</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_tools_gradle.html">Gradle</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_tools_ant.html">Ant</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_tools_java_api.html">PMD Java API</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_userdocs_tools_ci.html">CI integrations</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li class="active"><a href="pmd_userdocs_tools.html">Other Tools / Integrations</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">Rule Reference</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Apex Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_design.html">Design</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_documentation.html">Documentation</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_performance.html">Performance</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_apex_security.html">Security</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Ecmascript Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_ecmascript.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_ecmascript_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_ecmascript_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_ecmascript_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">HTML Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_html.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_html_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Java Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_design.html">Design</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_documentation.html">Documentation</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_multithreading.html">Multithreading</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_performance.html">Performance</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_java_security.html">Security</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Java Server Pages Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp_design.html">Design</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_jsp_security.html">Security</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Maven POM Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_pom.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_pom_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Modelica Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_modelica.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_modelica_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">PLSQL Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_plsql.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_plsql_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_plsql_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_plsql_design.html">Design</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_plsql_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Salesforce VisualForce Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vf.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vf_security.html">Security</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">VM Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vm.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vm_bestpractices.html">Best Practices</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vm_design.html">Design</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_vm_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">XML Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_xml.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_xml_errorprone.html">Error Prone</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">XSL Rules</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_xsl.html">Index</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_xsl_codestyle.html">Code Style</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_rules_xsl_performance.html">Performance</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">Language Specific Documentation</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_jsp.html">JSP Support</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Java Support</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_java.html">Java Versions</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_java_metrics_index.html">Java Code Metrics</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_apex_metrics_index.html">Apex code metrics</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_plsql.html">PLSQL</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_visualforce.html">Visualforce</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_xml.html">XML and XML dialects</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_html.html">HTML</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_languages_gherkin.html">Gherkin</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">Developer Documentation</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_development.html">Developer resources</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_building.html">Building PMD from source</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="https://github.com/pmd/pmd/blob/master/CONTRIBUTING.md" target="_blank">Contributing</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_writing_documentation.html">Writing documentation</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_roadmap.html">Roadmap</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_how_pmd_works.html">How PMD works</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_pmdtester.html">Pmdtester</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_rule_deprecation_policy.html">Rule Deprecation Policy</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Major contributions</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_major_rule_guidelines.html">Rule Guidelines</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_major_adding_new_language.html">Adding a new language</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_major_adding_new_cpd_language.html">Adding a new CPD language</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_major_adding_new_metrics_framework.html">Adding metrics support to a language</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Experimental features</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_devdocs_experimental_ast_dump.html">Creating (XML) dump of the AST</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<li>
|
||
|
||
<a href="#">Project documentation</a>
|
||
|
||
<ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Trivia about PMD</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_trivia_news.html">PMD in the press</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_trivia_products.html">Products & books related to PMD</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_trivia_similarprojects.html">Similar projects</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_trivia_meaning.html">What does 'PMD' mean?</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_faq.html">FAQ</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="license.html">License</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_credits.html">Credits</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_release_notes_old.html">Old release notes</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="subfolders">
|
||
<a href="#">Project management</a>
|
||
<ul>
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_committers_infrastructure.html">Infrastructure</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_committers_releasing.html">Release process</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_committers_merging_pull_requests.html">Merging pull requests</a></li>
|
||
|
||
|
||
|
||
|
||
|
||
<li><a href="pmd_projectdocs_committers_main_landing_page.html">Main Landing page</a></li>
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
<!-- if you aren't using the accordion, uncomment this block:
|
||
<p class="external">
|
||
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
|
||
</p>
|
||
-->
|
||
</ul>
|
||
|
||
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
|
||
<script>$("li.active").parents('li').toggleClass("active");</script>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<!-- Content Column -->
|
||
<div class="col-md-9" id="tg-sb-content">
|
||
<header>
|
||
<div class="row">
|
||
<div class="col-lg-12">
|
||
<a href="./" role="button"
|
||
><i class="fa fa-home fa-lg"></i
|
||
></a>
|
||
» Tools / Integrations
|
||
<a
|
||
target="_blank"
|
||
href="https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/tools/tools.md"
|
||
class="pull-right"
|
||
role="button"
|
||
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
|
||
>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<hr />
|
||
</header>
|
||
|
||
|
||
<div class="post-header">
|
||
<h1 class="post-title-main">Tools / Integrations</h1>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="post-content" data-github-edit-url="https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/tools/tools.md">
|
||
|
||
|
||
<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>
|
||
|
||
<h2 id="automated-code-review">Automated Code Review</h2>
|
||
|
||
<h3 id="codacy">Codacy</h3>
|
||
|
||
<p><a href="https://www.codacy.com/">Codacy</a> automates code reviews and monitors code quality on every commit and pull request.
|
||
It gives visibility into the technical debt and it can track code style and security issues, code coverage, code duplication, cyclomatic complexity and enforce best practices.
|
||
Codacy is static analysis without the hassle.</p>
|
||
|
||
<p>With Codacy you have PMDJava analysis out-of-the-box, and it is free for open source projects.</p>
|
||
|
||
<ul>
|
||
<li>Homepage: <a href="https://www.codacy.com/">https://www.codacy.com/</a></li>
|
||
<li>Source code: <a href="https://github.com/codacy/codacy-pmdjava">https://github.com/codacy/codacy-pmdjava</a></li>
|
||
<li>Maintainer: Codacy</li>
|
||
</ul>
|
||
|
||
<h3 id="codiga">Codiga</h3>
|
||
|
||
<p><a href="https://www.codiga.io">Codiga</a> automates code review, check your code quality and helps you manage your technical debt.
|
||
It is integrated with GitHub, GitLab and Bitbucket. The platform also analyzes code directly in your IDE using its integration
|
||
plugins for VS Code and IntelliJ, providing a consistent analysis along your development cycle (from the IDE to the CI/CD pipeline).</p>
|
||
|
||
<p>Codiga uses PMD to check Java and Apex code.</p>
|
||
|
||
<ul>
|
||
<li>Homepage: <a href="https://www.codiga.io">https://www.codiga.io</a></li>
|
||
<li>Documentation: <a href="https://doc.codiga.io">https://doc.codiga.io</a></li>
|
||
</ul>
|
||
|
||
<h3 id="github-actions">GitHub Actions</h3>
|
||
|
||
<p>PMD provides its own GitHub Action, that can be integrated in custom workflows.</p>
|
||
|
||
<p>It can execute PMD with your own ruleset against your project. It creates a <a href="https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html">SARIF</a>
|
||
report which is uploaded as a build artifact. Furthermore the build can be failed based on the number of violations.</p>
|
||
|
||
<p>The action can also be used as a code scanner to create “Code scanning alerts”.</p>
|
||
|
||
<ul>
|
||
<li>Homepage: <a href="https://github.com/pmd/pmd-github-action">pmd/pmd-github-action</a></li>
|
||
</ul>
|
||
|
||
<h2 id="ide-integrations">IDE Integrations</h2>
|
||
|
||
<h3 id="summary">Summary</h3>
|
||
|
||
<table>
|
||
<tr>
|
||
<th>IDE</th>
|
||
<th>Homepage</th>
|
||
<th>Source Code</th>
|
||
<th>Maintainers</th>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#bluej">BlueJ</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-misc/tree/master/pmd-bluej/">pmd-bluej</a></td>
|
||
<td><a href="http://tomcopeland.blogs.com/">Tom Copeland</a></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#code-guide">CodeGuide</a></td>
|
||
<td></td>
|
||
<td>N/A</td>
|
||
<td>Austin Moore</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#eclipse">Eclipse</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-eclipse-plugin">github: pmd/pmd-eclipse</a></td>
|
||
<td>Philippe Herlin</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>qa-Eclipse</td>
|
||
<td></td>
|
||
<td><a href="https://github.com/ChristianWulf/qa-eclipse-plugin">qa-Eclipse</a></td>
|
||
<td>Christian Wulf</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>eclipse-pmd</td>
|
||
<td><a href="http://acanda.github.io/eclipse-pmd/">http://acanda.github.io/eclipse-pmd/</a></td>
|
||
<td><a href="https://github.com/acanda/eclipse-pmd/">github: acanda/eclipse-pmd</a></td>
|
||
<td>Philip Graf</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#emacs">Emacs</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-emacs/">github: pmd/pmd-emacs</a></td>
|
||
<td>Nascif Abousalh Neto</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#gel">Gel</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-misc/tree/master/pmd-gel/">github: pmd/pmd-misc/pmd-gel</a></td>
|
||
<td>Andrei Lumianski</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Gradle</td>
|
||
<td><a href="https://docs.gradle.org/current/userguide/pmd_plugin.html">Gradle: The PMD Plugin</a></td>
|
||
<td><a href="https://github.com/gradle/gradle/tree/master/subprojects/code-quality">github: gradle/gradle</a></td>
|
||
<td><a href="https://gradle.org/">Gradle.org</a></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#idea">IntelliJ IDEA</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/amitdev/PMD-Intellij">github: amitdev/PMD-Intellij</a></td>
|
||
<td>Amit Dev</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#idea---qaplug">IntelliJ IDEA - QAPlug</a></td>
|
||
<td><a href="http://qaplug.com/">http://qaplug.com/</a></td>
|
||
<td>N/A</td>
|
||
<td>Jakub Sławiński</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#jbuilder">JBuilder</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-misc/tree/master/pmd-jbuilder/">github: pmd/pmd-misc/pmd-jbuilder</a></td>
|
||
<td><a href="http://tomcopeland.blogs.com/">Tom Copeland</a></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#jcreator">JCreator</a></td>
|
||
<td></td>
|
||
<td>N/A</td>
|
||
<td>Brant Gurganus</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#jdeveloper">JDeveloper</a></td>
|
||
<td></td>
|
||
<td><a href="https://github.com/pmd/pmd-jdeveloper">github: pmd/pmd-jdeveloper</a></td>
|
||
<td><a href="http://develishdevelopment.wordpress.com/">Torsten Kleiber</a></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#jedit">JEdit</a></td>
|
||
<td><a href="http://plugins.jedit.org/plugins/?PMDPlugin">jEdit - PMD Plugin</a></td>
|
||
<td><a href="https://sourceforge.net/p/jedit/PMDPlugin/ci/master/tree/">sourceforge: jedit/PMDPlugin</a></td>
|
||
<td>Jiger Patel, Dale Anson</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#netbeans">NetBeans</a></td>
|
||
<td><a href="http://kenai.com/projects/sqe/">SQE</a></td>
|
||
<td><a href="https://github.com/sqe-team/sqe">github: sqe-team/sqe</a></td>
|
||
<td>N/A</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#textpad">TextPad</a></td>
|
||
<td></td>
|
||
<td>N/A</td>
|
||
<td>Jeff Epstein</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td><a href="#weblogic-workshop-81x">WebLogic Workshop 8.1.x</a></td>
|
||
<td></td>
|
||
<td>N/A</td>
|
||
<td>Kevin Conaway</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<h3 id="general-comments">General comments</h3>
|
||
|
||
<p>A general note - most plugins include the PMD jar files, which has the rulesets
|
||
inside it. So even though the rulesets parameter that some plugins
|
||
use (i.e., “rulesets/java/unusedcode.xml”) looks like a filesystem reference, it’s really
|
||
being used by a getResourceAsStream() call to load it out of the PMD jar files.</p>
|
||
|
||
<h3 id="bluej">BlueJ</h3>
|
||
|
||
<p><a href="http://bluej.org/">BlueJ</a> is a teaching IDE. To install the PMD extension for BlueJ, download
|
||
the <a href="http://sourceforge.net/projects/pmd/files/pmd-bluej/pmd-bluej-1.0/">PMDExtension jar file</a>
|
||
and place it in your <code class="language-plaintext highlighter-rouge">bluej/lib/extensions/</code> directory.</p>
|
||
|
||
<h3 id="eclipse">Eclipse</h3>
|
||
|
||
<p>To install the PMD plugin for Eclipse:</p>
|
||
|
||
<ul>
|
||
<li>Start Eclipse and open a project</li>
|
||
<li>Select “Help”->”Software Updates”->”Find and Install”</li>
|
||
<li>Click “Next”, then click “New remote site”</li>
|
||
<li>Enter “PMD” into the Name field and <a href="https://pmd.github.io/pmd-eclipse-plugin-p2-site/">https://pmd.github.io/pmd-eclipse-plugin-p2-site/</a> into the URL field</li>
|
||
<li>Click through the rest of the dialog boxes to install the plugin</li>
|
||
</ul>
|
||
|
||
<p>Alternatively, you can download the latest zip file and follow the above procedures
|
||
except for using “New local site” and browsing to the downloaded zip file.</p>
|
||
|
||
<p>To configure PMD, select “Windows”->”Preferences”, then select PMD.</p>
|
||
|
||
<p>To run PMD, right-click on a project node and select “PMD”->”Check code with PMD”.</p>
|
||
|
||
<p>To run the duplicate code detector, right-click on a project node and
|
||
select “PMD”->”Find suspect cut and paste”. The report will be placed in a “reports” directory
|
||
in a file called “cpd-report.txt”.</p>
|
||
|
||
<p>To find additional help for other features, please read included help by selecting
|
||
Help->Help Contents and browse the “How to…” section in the “PMD Plugin Documentation” book.</p>
|
||
|
||
<p>After installing an update, if you get an Exception such as
|
||
“java.lang.RuntimeException: Couldn’t find that class xxxxx”,
|
||
try deleting the ruleset.xml file in the .metadata/plugins/net.sourceforge.pmd.eclipse directory in your workspace.</p>
|
||
|
||
<p>To get Eclipse to not flag the @SuppressWarnings(“PMD”) annotation, look
|
||
under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Warning Token.</p>
|
||
|
||
<h3 id="emacs">Emacs</h3>
|
||
|
||
<p>Integration with GNU Emacs is performed through an ELisp package, pmd.el.
|
||
It supports two commands, “pmd-current-buffer” and “pmd-current-dir”.
|
||
The output is captured in a compilation buffer which allows the user to “jump”
|
||
directly to the source code position associated with the PMD warnings.</p>
|
||
|
||
<h3 id="gel">Gel</h3>
|
||
|
||
<p>Here’s how to set up the Gel plugin:</p>
|
||
|
||
<ul>
|
||
<li>Download the pmd-gel-[version].zip file</li>
|
||
<li>Close Gel</li>
|
||
<li>Remove any old plugin versions from your gel\plugins directory</li>
|
||
<li>Unzip the new zip file into your gel\plugins directory</li>
|
||
<li>Start Gel</li>
|
||
<li>Go to Tools->Options->Plugin</li>
|
||
<li>Select the PMD plugin and click “Remove”</li>
|
||
<li>Click “Add” and select “net.sourceforge.pmd.gel.PMDPlugin”</li>
|
||
<li>Restart Gel</li>
|
||
</ul>
|
||
|
||
<p>That’s pretty much it. Now you can open a Java project and click on Plugins->PMD and
|
||
a configuration panel will pop up. You can pick which ruleset you want to run and
|
||
you can also pick whether you want to run PMD on the current file or on every
|
||
source file in your project.</p>
|
||
|
||
<h3 id="idea">IDEA</h3>
|
||
|
||
<p>You can use an integrated plugin or just use it as an IDEA “External Tool”.</p>
|
||
|
||
<p>Amit Dev wrote an integrated plugin for IDEA; you can download that
|
||
<a href="http://plugins.jetbrains.com/idea/plugin/1137-pmdplugin">from the IntelliJ plugins site</a>.</p>
|
||
|
||
<p>Here’s how to set it up as an “External Tool”:</p>
|
||
|
||
<ul>
|
||
<li>Open IDEA and go to File->Settings</li>
|
||
<li>Click on the “External Tools” icon</li>
|
||
<li>Click on the Add button</li>
|
||
<li>Fill in the blocks
|
||
<ul>
|
||
<li>Name: PMD</li>
|
||
<li>Description: PMD, good for what ails you.</li>
|
||
<li>Menu: Select the “Main menu”, “Project views”, “Editor menu”, and “Search results” checkboxes.</li>
|
||
<li>Program: <code class="language-plaintext highlighter-rouge">c:\pmd\bin\pmd.bat</code></li>
|
||
<li>For the next parameter you’ll need to plug in the location of your PMD installation
|
||
and the rulesets you want to use</li>
|
||
<li>Parameters:
|
||
<code class="language-plaintext highlighter-rouge">-d "$FilePath$" -f ideaj -R rulesets/java/quickstart.xml -P sourcePath="$Sourcepath$" -P classAndMethodName=$FileClass$.method -P fileName=$FileName$</code></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<p>That’s pretty much it. Now you can right click on a source directory and select PMD,
|
||
it’ll run recursively on the source files, and the results should
|
||
be displayed in a window and hyperlinked into the correct file and line of code. I usually
|
||
right-click on the message window title bar and unselect “autohide” so the window doesn’t go
|
||
away every time I fix something in the code window.</p>
|
||
|
||
<h3 id="idea---qaplug">IDEA - QAPlug</h3>
|
||
|
||
<p>QAPlug is an Intellij IDEA plugin to manage code quality. It integrates no less than Checkstyle, FindBugs, and PMD.</p>
|
||
|
||
<p>The plugin is available at <a href="http://www.qaplug.com/">http://www.qaplug.com/</a>.</p>
|
||
|
||
<p>Also available at the JetBrains site, <a href="http://plugins.jetbrains.com/idea/plugin/4596-qaplug--pmd">QAPlug-PMD</a>
|
||
and <a href="http://plugins.jetbrains.com/idea/plugin/4594-qaplug">QAPlug</a>.</p>
|
||
|
||
<h3 id="jbuilder">JBuilder</h3>
|
||
|
||
<p>To enable this OpenTool in JBuilder:</p>
|
||
|
||
<ul>
|
||
<li>Download the <a href="https://sourceforge.net/projects/pmd/files/pmd-jbuilder/">latest binary release</a></li>
|
||
<li>Unzip it into your <code class="language-plaintext highlighter-rouge">jbuilder/lib/ext/</code> directory</li>
|
||
<li>Restart JBuilder</li>
|
||
</ul>
|
||
|
||
<p>What you can do:</p>
|
||
|
||
<ul>
|
||
<li>Check a single file by bringing up the context menu from the file tab and selecting PMDCheck</li>
|
||
<li>Configure the rulesets that the PMD OpenTool will use by selecting Tools->PMD->Configure PMD</li>
|
||
<li>Check all the files in a project by bringing up the context menu for
|
||
the project node and selecting PMD Check Project</li>
|
||
<li>Locate duplicate code by right clicking on a package and selection “Check with CPD”</li>
|
||
</ul>
|
||
|
||
<p>When running PMD, the results will be displayed in the MessageView under a tab called PMD Results. If you click on a
|
||
violation message within this view, you will be taken to the line in the source code where the violation was detected.</p>
|
||
|
||
<p>Things still to do:</p>
|
||
|
||
<ul>
|
||
<li>Enable selection of individual rules within a rule set (maybe)</li>
|
||
<li>Optional insertion of @todo comments at the point of a violation</li>
|
||
<li>Possibly provide configurable ability to limit the number of violations per rule per file</li>
|
||
</ul>
|
||
|
||
<h3 id="jcreator">JCreator</h3>
|
||
|
||
<ol>
|
||
<li>Open Configure > Options</li>
|
||
<li>Go to the Tools panel</li>
|
||
<li>Click New > Program</li>
|
||
<li>Browse for PMD’s pmd.bat</li>
|
||
<li>Put quotations around the path if it has spaces.</li>
|
||
<li>Set the initial directory to PMD’s \bin directory</li>
|
||
<li>Check capture output</li>
|
||
<li>Put ‘”$[PrjDir]” emacs’ followed by desired rulesets in the arguments</li>
|
||
</ol>
|
||
|
||
<p>To run PMD on a project, just pick pmd from the Tools menu.</p>
|
||
|
||
<h3 id="jdeveloper">JDeveloper</h3>
|
||
|
||
<p>To install the PMD plugin for JDeveloper:</p>
|
||
|
||
<ul>
|
||
<li>JDeveloper 10.1.2: Download the binary release and unzip it into your jdev/lib/ext directory</li>
|
||
<li>JDeveloper 10.1.3 upwards: Click “Help”, click “Check for Updates”
|
||
<ul>
|
||
<li>JDeveloper 10.1.3:
|
||
<ul>
|
||
<li>Press “Add” to add a new update center</li>
|
||
<li>Name: PMD Update Center</li>
|
||
<li>Location: <a href="http://pmd.sourceforge.net/center.xml">http://pmd.sourceforge.net/center.xml</a></li>
|
||
<li>Select Update Center: PMD Update Center</li>
|
||
</ul>
|
||
</li>
|
||
<li>JDeveloper 11 upwards: Select Update Center: Open Source and Partner Extensions</li>
|
||
<li>Press Next and select the actual PMD Plugin and install it</li>
|
||
</ul>
|
||
</li>
|
||
<li>Restart JDeveloper</li>
|
||
</ul>
|
||
|
||
<p>To run the PMD plugin for JDeveloper:</p>
|
||
|
||
<ul>
|
||
<li>Open the Tools-&Preferences menu</li>
|
||
<li>Click on the PMD option</li>
|
||
<li>Select a couple of rules to try</li>
|
||
<li>To run PMD, right click on either a file, folder, package, project or workspace and select PMD via
|
||
Toolbar Icon, Context Menu or File Menu</li>
|
||
<li>Any rule violations should show up in a LogWindow tab at the bottom of the screen</li>
|
||
</ul>
|
||
|
||
<h3 id="jedit">JEdit</h3>
|
||
|
||
<p>The way I use the JEdit plugin is:</p>
|
||
|
||
<ul>
|
||
<li>Dock the ErrorList by going to Utilities->Global Options->Docking and
|
||
putting ErrorList at the bottom of the screen</li>
|
||
<li>Open the File Browser if it isn’t already open</li>
|
||
<li>Double-click on a source directory</li>
|
||
<li>Select Plugins->PMD->Check directory recursively</li>
|
||
</ul>
|
||
|
||
<p>Note that you can select individual rules by going to Utilities->Global Options->Plugin Options->PMD.
|
||
Also, you can change the plugin to prompt you for a directory to check by going to that same menu and
|
||
selecting the “Ask for Directory” checkbox.</p>
|
||
|
||
<h3 id="netbeans">NetBeans</h3>
|
||
|
||
<p>The <a href="http://kenai.com/projects/sqe/">SQE</a> project includes PMD integration for NetBeans.</p>
|
||
|
||
<h3 id="textpad">TextPad</h3>
|
||
|
||
<p><strong>Assumptions</strong></p>
|
||
|
||
<ul>
|
||
<li>The Java Development Kit, version 1.4.2 (versions 1.4 and higher are acceptable) is properly installed
|
||
into your machine, and exists in <code class="language-plaintext highlighter-rouge">D:\java\jdk\_142\</code>. This means that <code class="language-plaintext highlighter-rouge">D:\java\jdk\_142\bin\java.exe</code> exists.</li>
|
||
<li>PMD version 5.0 exists in <code class="language-plaintext highlighter-rouge">D:\java\pmd-bin-\</code>.
|
||
This means that <code class="language-plaintext highlighter-rouge">D:\java\pmd-bin-\lib\pmd-.jar</code> (among other jar files
|
||
in the same directory) exist.</li>
|
||
</ul>
|
||
|
||
<p><strong>To integrate into TextPad</strong></p>
|
||
|
||
<ol>
|
||
<li>In the <strong>Configure</strong> menu, choose <strong>Preferences…</strong>. This opens the Preferences dialog</li>
|
||
<li>In the left pane of the Preferences dialog, choose the <strong>Tools</strong> branch by clicking on the <em>word</em> “Tools”.</li>
|
||
<li>On the far right of the dialog, click on the <strong>Add</strong> button, and then select <strong>Program…</strong> from the drop-down.
|
||
This opens the standard Windows Open File dialog.</li>
|
||
<li>Type <code class="language-plaintext highlighter-rouge">D:\java\jdk_142\bin\java.exe</code> and click the <strong>Open</strong> button. In the center pane of the Preferences dialog,
|
||
an item “Java” has now been added, and is currently selected.</li>
|
||
<li>Click the word Java, which makes the word editable. Select the entire word, and type “PMD directory”. Press Return.</li>
|
||
<li>Repeat steps three through five, but type “PMD file”, instead of “PMD directory”.</li>
|
||
<li>Click <strong>Apply</strong>.</li>
|
||
<li>Expand the <strong>Tools</strong> branch (if not already) by clicking on the ‘<code class="language-plaintext highlighter-rouge">+</code>’ directly to its left.</li>
|
||
<li>In the expanded list, select <strong>PMD directory</strong>. This changes the right side of this dialog to the “tool” form.</li>
|
||
<li>In the “tool” form, enter these parameters:
|
||
<ul>
|
||
<li><strong>Parameters:</strong> <code class="language-plaintext highlighter-rouge">-classpath D:\java\pmd-bin-\lib\pmd-.jar;D:\java\pmd-bin-\lib\asm-3.2.jar;D:\java\pmd-bin-\lib\jaxen-1.1.1.jar net.sourceforge.pmd.PMD -d <i><b>$FileDir</b></i> -f net.sourceforge.pmd.renderers.TextPadRenderer -R E:\directory\my_pmd_ruleset.xml -debug</code></li>
|
||
<li><strong>Initial Folder:</strong> <code class="language-plaintext highlighter-rouge">$FileDir</code></li>
|
||
<li><strong>Save all documents first:</strong> <code class="language-plaintext highlighter-rouge">Checked</code></li>
|
||
<li><strong>Capture output:</strong> <code class="language-plaintext highlighter-rouge">Checked</code></li>
|
||
<li><strong><em>All other checkboxes</em>:</strong> Unchecked</li>
|
||
<li><strong>Regular expression to match output:</strong> <code class="language-plaintext highlighter-rouge">^\([^(]+\)(\([0-9]+\),</code></li>
|
||
<li><strong>Registers/File:</strong> <code class="language-plaintext highlighter-rouge">1</code></li>
|
||
<li><strong>Registers/Line:</strong> <code class="language-plaintext highlighter-rouge">2</code></li>
|
||
</ul>
|
||
</li>
|
||
<li>In the expanded list, select <strong>PMD file</strong>.</li>
|
||
<li>In the “tool” form, enter the same parameters as above, except replace ‘<code class="language-plaintext highlighter-rouge">$FileDir</code>’ with ‘<code class="language-plaintext highlighter-rouge">$File</code>’,
|
||
in the Parameters textbox.</li>
|
||
<li>To save your work (truly, given a quirk of TextPad), click on <strong>OK</strong>, which closes the Preferences dialog.
|
||
Restart TextPad and re-open the Preferences dialog.</li>
|
||
<li>Go back to both the “PMD directory” and “PMD file” Tools branches, and replace ‘<code class="language-plaintext highlighter-rouge">E:\directory\my_pmd_ruleset.xml</code>’
|
||
with the ruleset of your choice. For example, <code class="language-plaintext highlighter-rouge">basic</code>.</li>
|
||
<li>Go to the <strong>Keyboard</strong> branch in the left pane (above <strong>Tools</strong>), which changes the right side to
|
||
the “keyboard configuration” form.</li>
|
||
<li>In the <strong>Categories</strong> list box, select <strong>Tools</strong>.</li>
|
||
<li>In the <strong>Command</strong> list box, select <strong>PMD directory</strong>.</li>
|
||
<li>Put your cursor into the <strong>Press new shortcut key</strong>, and type your desired key command.
|
||
For example <code class="language-plaintext highlighter-rouge">Ctrl+Page Up</code></li>
|
||
<li>Click <strong>Assign</strong>.</li>
|
||
<li>In the <strong>Command</strong> list box, select <strong>PMD file</strong>.</li>
|
||
<li>Put your cursor into the <strong>Press new shortcut key</strong>, and type your desired key command.
|
||
For example <code class="language-plaintext highlighter-rouge">Ctrl+Page Down</code></li>
|
||
<li>Click <strong>Assign</strong>.</li>
|
||
<li>Save your work again: Click on <strong>OK</strong>, which closes the Preferences dialog, and then restart TextPad.</li>
|
||
</ol>
|
||
|
||
<p><strong>To run PMD against a single Java file</strong></p>
|
||
|
||
<ol>
|
||
<li>In TextPad, open any Java file.</li>
|
||
<li>Click <code class="language-plaintext highlighter-rouge">Ctrl+Page Down</code>. This opens an empty, read-only text document (titled “Command Results”).
|
||
When PMD completes its analysis, this document will be populated with a listing of violated rules
|
||
(or “Command completed successfully” indicating no violations).</li>
|
||
<li>Double click any line to go to it.</li>
|
||
</ol>
|
||
|
||
<p><strong>To run PMD against a directory of Java files</strong></p>
|
||
|
||
<ol>
|
||
<li>In TextPad, open <em>any</em> file in the <em>root</em> directory you wish to analyze. Unfortunately, you’ll need to
|
||
create a dummy file, if no file exists there.</li>
|
||
<li>Click <code class="language-plaintext highlighter-rouge">Ctrl+Page Up</code>. This opens an empty, read-only text document (titled “Command Results”).
|
||
When PMD completes its analysis, this document will be populated with a listing of violated rules
|
||
(or “Command completed successfully” indicating no violations).</li>
|
||
<li>Double click any line to go to it.</li>
|
||
</ol>
|
||
|
||
<p><em>Because directory analysis may take a while, you may choose to cancel this operation. Do so by closing
|
||
the (blank Command Results) document, and then confirming that, “yes, I do really want to exit the tool”.</em></p>
|
||
|
||
<h3 id="weblogic-workshop-81x">WebLogic Workshop 8.1.x</h3>
|
||
|
||
<p>Please see <a href="http://pmdwlw.sf.net/">the WebLogic Workshop plugin project home page</a> for more information.</p>
|
||
|
||
|
||
<div class="tags">
|
||
|
||
<b>Tags: </b>
|
||
|
||
|
||
|
||
<a href="tag_userdocs.html" class="btn btn-default navbar-btn cursorNorm" role="button">userdocs</a>
|
||
|
||
|
||
|
||
<a href="tag_tools.html" class="btn btn-default navbar-btn cursorNorm" role="button">tools</a>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<footer>
|
||
|
||
<hr />
|
||
<div>
|
||
This documentation is written in markdown. <br />
|
||
If there is something missing or can be improved, edit this page on
|
||
github and create a PR:
|
||
<a
|
||
target="_blank"
|
||
href="https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/tools/tools.md"
|
||
role="button"
|
||
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
|
||
>
|
||
</div>
|
||
|
||
<hr />
|
||
<div class="row">
|
||
<div class="col-lg-12 footer">
|
||
©2022 PMD Open Source Project. All rights
|
||
reserved. <br />
|
||
Site last generated: Sep 24, 2022 <br />
|
||
<p>
|
||
<img src="images/pmd-logo-small.png" alt="Company
|
||
logo"/>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
|
||
</div>
|
||
|
||
<!-- /.row -->
|
||
</div>
|
||
<!-- /.container -->
|
||
</div>
|
||
|
||
|
||
<!-- Sticky TOC column -->
|
||
<div class="toc-col">
|
||
<div id="toc"></div>
|
||
</div>
|
||
|
||
<!-- /.toc-container-wrapper -->
|
||
</div>
|
||
</div>
|
||
</body>
|
||
|
||
</html>
|