
Introduction
PMD is an alternative to FindBugs and it is having good name in the market.
PMD stands for Programming Mistake Detector. It is a free source code analysis tool which helps you to find the bugs in your java code and improve the code quality. PMD helps to find empty try/catch/finally statements, while/if statements, unnecessary object creation etc.
PMD warning and problems are not exactly errors, but shows that particular code need to be improved
Following plugins are available for PMD
- Maven PMD plugin
- NetBeans PMD plugin
- JBuilder PMD plugin
- JDeveloper PMD plugin
- IntelliJ PMD plugin
Installation Steps
Please follow below steps to install and execute PMD plugin in your eclipse –
Step 1: You can install the PMD Eclipse plugin using Eclipse update manager from the following links
http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/
or
Step 2: Use the → menu entry to install all the PMD plugin components from the above URL.
Step 3: Enter the URL and name and click on OK button.
Click On Next button.
Step 4: Once you Click on OK Button then it display all available installation for eclipse, select appropriate eclipse version and click on Next button. Please find the screenshot below –
Step 5: After Clicking on Next button then it display license agreement . Select the License agreement and Click on Next button.
Step 6: Click on Finish button and it display below screen.
Step 7: Once installation completed then it ask to Restart eclipse, Restart your eclipse to validate PMD plugin in your eclipse.
Step 8: User can validate PMD plugin installation using Window -> Preferences option from the top menu.
Enter PMD in text area then it appear on the screen. please use the feature same as FindBugs to execute and generate Reports.
User Can execute PMD by Right Clicking on the project and Create Reports option, please find screenshot in the attachment.