Wednesday, January 28, 2015
PMD in Eclipse
Install
1.
In Eclipse, click on Help -> Install New
Software...
2.
Click on Add.. Enter the following:
3.
Name: PMD for Eclipse Update Site
4.
URL: https://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/
and click OK.
5.
You should see PMD for Eclipse 3. Select the
checkbox next to it and click Next >
Usage- Open new Perspective > Choose PMD
- Open any file and right click > PMD >
Check code with PMD
Violation outline will list out all of the warnings.
Navigate to the location of the code by double clicking on the warning.
1.
Go to Preferences > PMD > Rules
Configuration
2.
Hit 'Clear All' to remove all the default rules.
3.
Import your rule file and click Ok
Check style in Eclipse
Install:
- In Eclipse, click on Help -> Install New Software...
Usage:
Import Rule:
- In Eclipse, click on Help -> Install New Software...
- Click on Add.. Enter the following:
- Name: Checkstyle for Eclipse Update Site
- URL: http://eclipse-cs.sf.net/update/
and click OK.
- You should see Checkstyle. Select the checkbox
next to it and click Next >
- Open new View > Choose Checkstyle violations
- Open any file and right click > Checkstyle
> Check code with Checkstyle
- Go to Preferences > Checkstyle > Rules
Configuration
- Choose new to import new rule set.
- Select type as “External configuration file”,
browse the path to your rule file and click Ok.
Note: Remember to set your new rule as Default
FindBugs for Eclipse
Install:
1.
In Eclipse, click on Help -> Install New
Software...
2.
Click on Add.. Enter the following:
3.
Name: FindBugs for Eclipse
4.
URL: http://findbugs.cs.umd.edu/eclipse/
and click OK.
5.
You should see FindBugs. Select the checkbox
next to it and click Next >
Usage:
- Open new Perspective > Choose FindBugs
- Open any file and right click > Find Bugs > Check code with Find Bugs
Now you can see the list of bugs
(potential risks, best practice issues) in Bug
Explorer.
Click on each bug and then you can
see in Bug Info the detail,
description and suggestion to solve the bug.
Subscribe to:
Posts (Atom)