diff --git a/pmd-web/readme.txt b/pmd-web/readme.txt new file mode 100644 index 0000000000..b6205de131 --- /dev/null +++ b/pmd-web/readme.txt @@ -0,0 +1,31 @@ +INSTALL +This should work on pretty much any CVS server, however, all the server names and directories are hardcoded. + +- install Perl and Ruby (http://www.ruby-lang.org/) if they're not already installed + +- check out the code from Sourceforge + +- put webpmd.pl and PMD/Project.pm in your cgi-bin directory + +- create a cgi-bin/jobs directory and put jobs in there in the format: +File name: something unique, usually reponame_modulename.txt, i.e., pmd_pmd-jedit.txt +File contents: Sourceforge:PMD-JEdit:pmd:pmd-jedit:pmd-jedit/src + +- create a reports/ directory under htdocs + +- put processor.rb and pmd.rb in your home directory + +- edit processor.rb and point it to your reports directory and your jobs directory + +- set up a cron job: +10 0,3,6,9,12,15,18,21 * * * nice -n 19 /path/to/processor.rb + +- let the fun begin! + +I realize these are lousy instructions, but I'm not sure if anyone other than I will ever read them. Thus, updates are welcome. + + +CHANGELOG +1/22/03 - Added this file + +1/21/03 - Updated to use new SF CVS configuration \ No newline at end of file diff --git a/pmd-web/src/PMD/Project.pm b/pmd-web/src/PMD/Project.pm index ef3c3f473e..8ff9e66ea1 100644 --- a/pmd-web/src/PMD/Project.pm +++ b/pmd-web/src/PMD/Project.pm @@ -35,12 +35,11 @@ sub getLines() { open(FILE,getRptFile($self)); my @x = ; close(FILE); - my $y = @x; - my $lines = sprintf("%0.f", ($y-5)/4); - if ($lines == "-0" || $lines == "-1") { - $lines = "0"; + my $lines; + foreach (@x) { + $lines = $lines + 1 if $_ =~ "PMD-WEB"); print "PMD is a Java source code analysis tool - it checks your code for unused fields, empty try/catch/finally/if/while blocks, unused method parameters, and stuff like that. There's much more info here.

This table contains the results of running PMD's unused code ruleset against a bunch of Sourceforge and Jakarta projects."; - print "

1/21/03: This page has been down for a few days due to Sourceforge CVS migrations, but it's back on the hourly cycle now"; + print "

1/21/03: This page has been down for a few days due to Sourceforge CVS migrations, but it's back on the three hour cycle now"; print hr(); if (param("location")) { @@ -66,14 +66,14 @@ sub printStats() { print br(); print "The last run took ", sprintf("%.0f", $lastruntime/60), " minutes"; print br(); - print "This report is regenerated every two hours at 10 minutes past the hour"; + print "This report is regenerated every three hours at 10 minutes past the hour"; print br(); } sub getTimeUntil() { # we're starting each build at 10 past the hour, so... my $offset = 10; - my $everyXHours = 2; + my $everyXHours = 3; my $minutes = ((60 + $offset) - localtime()->min) % 60; if (localtime()->hour % $everyXHours != 0) { $minutes += 60;