2003-02-11 23:03:38 +00:00
|
|
|
PMD for NetBeans.
|
|
|
|
|
2002-10-28 22:36:20 +00:00
|
|
|
------------------------
|
|
|
|
INSTALL
|
|
|
|
------------------------
|
|
|
|
|
2003-02-11 23:03:38 +00:00
|
|
|
1) Start NetBeans
|
2007-11-15 05:53:57 +00:00
|
|
|
2) Goto Tools --> Plugins
|
|
|
|
3) Switch to 'Downloaded' tab
|
|
|
|
4) Press 'Add plugins'
|
|
|
|
5) Goto the directory where you downloaded pmd-netbeans and choose the file "pmd.nbm".
|
|
|
|
6) Press OK
|
|
|
|
7) Press Install
|
|
|
|
8) Accept the license
|
|
|
|
9) Confirm installation of an usigned module
|
2002-10-28 22:36:20 +00:00
|
|
|
|
|
|
|
------------------------
|
|
|
|
USE
|
|
|
|
------------------------
|
|
|
|
|
2003-02-11 23:03:38 +00:00
|
|
|
Right click on one or more folders or Java files, choose Tools -> PMD and watch the tool
|
|
|
|
find your flaws. The tool is also located under the global Tools menu. Double
|
|
|
|
click on the error messages in the output pane to go to the line in the
|
|
|
|
Java source file to correct the problem PMD discovered.
|
2002-10-28 22:36:20 +00:00
|
|
|
|
2003-04-23 20:09:12 +00:00
|
|
|
XXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
|
X OPTIONS X
|
|
|
|
XXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
|
|
2002-10-28 22:36:20 +00:00
|
|
|
------------------------
|
2003-04-23 20:09:12 +00:00
|
|
|
RULES
|
2002-10-28 22:36:20 +00:00
|
|
|
------------------------
|
2003-02-11 23:03:38 +00:00
|
|
|
1) Start NetBeans
|
2006-01-27 15:04:08 +00:00
|
|
|
2) Goto Tools --> Options
|
|
|
|
3) Navigate to Miscelaneous section and expand PMD node
|
2002-12-02 22:36:29 +00:00
|
|
|
4) Click on "Rules"
|
|
|
|
5) Click on the [...] button
|
|
|
|
6) Select the different rules to see information and examples of the rule
|
|
|
|
7) Use the <, <<, >, >>, buttons to choose which rules to use.
|
|
|
|
8) Press OK to save the configuration
|
2003-04-23 20:09:12 +00:00
|
|
|
|
|
|
|
------------------------
|
|
|
|
CUSTOM RULESETS
|
|
|
|
------------------------
|
|
|
|
1) Start NetBeans
|
2006-01-27 15:04:08 +00:00
|
|
|
2) Goto Tools --> Options
|
|
|
|
3) Navigate to Miscelaneous section and expand PMD node
|
2003-04-23 20:09:12 +00:00
|
|
|
5) Click on "Rulesets"
|
|
|
|
6) Click "Add RuleSet" to locate the ruleset xml file you want to include
|
|
|
|
7) Click "Add Rule jar" to locate the jar containing the rules
|
|
|
|
8) Check "Include PMD standard rules" to include the rules from the pmd distribution
|
|
|
|
9) Press OK to save the configuration
|
|
|
|
10) Go to Rules to select the new rules.
|
|
|
|
|
|
|
|
------------------------
|
|
|
|
REALTIME SCANNING
|
|
|
|
------------------------
|
|
|
|
1) Start NetBeans
|
2006-01-27 15:04:08 +00:00
|
|
|
2) Goto Tools --> Options
|
|
|
|
3) Navigate to Miscelaneous section and expand PMD node
|
2007-11-15 05:53:57 +00:00
|
|
|
4) Select "Enable scan"
|