I don't make software; I make it Better

• 2010-Mar-9 - Jave Code Auditing Tools and Cmds (PMD and CheckStyle)


PMD
and Checkstyle are the well known Open source Java Code auditing Tools.
 
According to the PMD documentation, the tool checks for the following things in the code:

Unused local variables
Empty catch blocks
Unused parameters
Empty if statements
Duplicate import statements
Unused private methods
Classes that could be Singletons
Short/long variable and method names

Checkstyle looks for these things:

Javadoc comments
Naming conventions
Headers
Imports
Size violations
White space
Modifiers
Blocks
Miscellaneous checks (including some useful checks like unnecessary System.out and printstackTrace)

Check Style
===========
Commands
========

java -jar checkstyle-all-5.1.jar -c sun_checks.xml -f xml -r C:\tp\workspace\Phase2\extend\src\org\compiere\*.java -o checkstyle_report.xml

Add the following line in the output xml (checkstyle_report.xml) file after the first line.

lessthansymbol?xml-stylesheet type="text/xsl" href="checkstyle-author.xsl"?greatthansymbol

PMD:
====
Commands
========

java -jar pmd-4.2.5.jar C:\tp\workspace\3APhase2\extend\src\org\compiere nicehtml unusedcode,basic,imports,design -xslt pmd-report-per-class.xslt -reportfile PMD.html

Style Sheets :(for reporting purpose)

cpdhtml.xslt
pmd-report-per-class.xslt
wz-pmd-report.xslt
corley-pmd-report.xslt
pmd-report.xslt


:: Send to a Friend!

About Me


«  May 2012  »
MonTueWedThuFriSatSun
 123456
78910111213
14151617181920
21222324252627
28293031 

Links

Home
View my profile
Archives
Friends
Email Me
My Blog's RSS

Friends

strazzerj
ally
whollymindless
Entry 1 of 5
Last Page | Next Page