Technical details
Overview
An Ant script runs three custom tasks:
- An ant contribution task that reads a list of directories from a properties file and loops through the directory names.
- PMD which checks the source code for style and duplicate code
- QJ PRO which checks the source code for impact of bugs
- After looping through the sub projects a zip archive is made of the results.
- The zip files are expanded by hand under the control of a web server.
- An index page is roughly generated by a very stupid Perl script and then the details filled in by hand.
- The tool sloccount is run by hand and the results placed also under the webserver
- Two Perl scripts generate condensed HTML reports based on a simple search filter.
- Human reviews are planned to filter the information further.
Resources
PMD - http://pmd.sourceforge.net/
QJPRO - http://qjpro.sourceforge.net/
Findbugs - http://findbugs.sourceforge.net/
Configuration Ant
The code: http://bugs.sakaiproject.org/confluence/download/attachments/19957/beta_1_code_review.tar.gz
The batch command 2_005.sh runs a number of Ant builds after setting the memory settings via exporting ANT_OPT. E.G.:
export ANT_OPT=-Xmx1024M
The conf variable is passed to the build file via ant -Dconf=
This allows us to divide the code reviews up so that the tasks do not crash due to memory issues.
The default target in the build file is MAIN. Which loops through the list of projects contained in the property file as a comma delineated list of the projects property. E.G:
projects=access,alias,announcement,archive,assignment,authz
The other properties that effect the build are:
label=part1_l54_sakai_2-2-005_ #Used as the begiining of the archived zip file
src=/home/alan/src/sakai_2-2-005 # Location of the top level of the source dcode
projects=access,alias,announcement,archive,assignment,authz
qjpro_home=/home/alan/qjpro_V2.2.0 # location of the home directory of PMD. You will need to download the binary from the Internet http://pmd.sourceforge.net/.
out=output # Output directory
archive=archive # Archive directory
qjconf=conf/l5_l4.cfg # Which configuration file you wish to use for QJPRO. I have created three standard configurations, l5_l4.cfg is for level 5 and 4 impacts. I would advise you to browse the configuration file and compare the tests enabled by setting to true against. More information can be found at http://qjpro.sourceforge.net/ant.html
cpd.min_token=100 # number of tokens seen before duplicate code is declared.
Therefore the rules for qjpro may be set in the file mentioned by the qjconf property. However for pmd the rulesets are mentioned in the pmd target. What the meaning of each ruleset is, is mentioned at: http://pmd.sourceforge.net/rules/index.html (left hand menu)
TODO
- Clean prototype build code and release to community
- Generate reports for 006 when it arrives
- Add extra reports
- Peer review the reports to find the top 100 bugs
- Documentation
- Kill false positives
- Make drill down reports with more checks for the more painful projects
- Support the brave that wish to use the code or improve it locally
- Add Findbugs to the list of reports