Static source code analysis tools: PMD's installation and configuration

Source: Internet
Author: User

WindowsRequirements:

  • Java JRE 1.5 or higher (see section below for Java JRE 1.4 Support)
  • WinZip or the free
    7-zip

Download the latest binary distribution (http://pmd.sourceforge.net/)-I. e., pmd-bin-x.xx.zip

Unzip it into any directory, I. e., D: \ PMD \

========================================================== ========================================================== ========================================================== =====

Eclipse

To install the PMD plugin for Eclipse:

  • Start eclipse and open a project
  • Select "help"-> "Software Updates"-> "find and install"
  • Click "Next", then click "new remote site"
  • Enter "PMD" into the name field and
    Http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/ into the URL Field
  • Click through the rest of the dialog boxes to install the plugin

Alternatively, you can download the latest ZIP file and follow the aboveprocedures before t for using "new local site" and browsing to thedownloaded ZIP file.

To configure PMD, select "Windows"-> "Preferences", then select PMD.

To run PMD, right-click on a project node and select "PMD"-> "check code with PMD ".

To run the duplicate code detector, right-click on a project node andselect "PMD"-> "find Suspect cut and paste ". the reportwill be placed in a "reports" directory in a file called "cpd-report.txt ".

To find additional help for other features, please read completed ded help byselecting help-> help contents and browse the "how to..." sectionin the "PMD plugin documentation" book.

After installing an update, if you get an exception such as "Java. lang. runtimeexception: couldn't find that class XXXXX ", trydeleting the ruleset. XML file in. metadata/plugins/net. sourceForge. PMD. eclipse directory in your workspace.

To get eclipse to not flag the @ suppresswarnings ("PMD") annotation, look under the menu headings Java-> compiler-> errors/warnings-> annotations-> unhandled warning token.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.