Various tweaks

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1491 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-02-28 03:46:20 +00:00
parent aa716a6672
commit 292e201035
5 changed files with 12 additions and 14 deletions

View File

@ -39,7 +39,7 @@ sub getLines() {
foreach (@x) {
$lines = $lines + 1 if $_ =~ "<td ";
}
return sprintf("%0.f", $lines/3);
return sprintf("%0.f", $lines/4);
}
sub getLocation() {
my $self = shift;

Binary file not shown.

View File

@ -47,7 +47,7 @@ class Job
end
def run_pmd
cmd="java -jar pmd-1.0.jar \"#{@sourceDirectory}\" html rulesets/unusedcode.xml > \"#{reportFile()}\""
cmd="java -jar pmd-1.03.jar \"#{@sourceDirectory}\" html rulesets/unusedcode.xml > \"#{reportFile()}\""
`#{cmd}`
arr = IO.readlines(reportFile())
newFile=File.open(reportFile(), "w")

View File

@ -15,12 +15,10 @@ jobsDir.each { |candidate|
end
job = PMD::Job.new(location,title,unixname,moduleDir,srcDir)
#puts "Processing #{job}"
File.open("/home/groups/p/pm/pmd/cgi-bin/currentjob.txt", "w") { |file| file.syswrite(job.unixName) }
job.clear
job.checkout_code
job.run_pmd
job.clear
File.delete("/home/groups/p/pm/pmd/cgi-bin/currentjob.txt");
end
rescue
puts "Exiting with error: #{$!}"
@ -28,5 +26,5 @@ jobsDir.each { |candidate|
}
stop=Time.now
`echo #{stop-start} > /home/groups/p/pm/pmd/cgi-bin/lastruntime.txt`
`echo #{stop} > /home/groups/p/pm/pmd/cgi-bin/lastruntime.txt`

View File

@ -21,11 +21,17 @@ sub default() {
print h3("<center>PMD-WEB</center>");
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 <a href=\"http://pmd.sf.net/\">here</a>.<p>This table contains the results of running PMD's <a href=\"http://pmd.sourceforge.net/rules/unusedcode.html\">unused code ruleset</a> against a bunch of Sourceforge projects.";
print "<p>Comments? Questions? Please post them <a href=\"http://sourceforge.net/forum/forum.php?forum_id=188192\">here</a>";
print "<p><b>1/29/03: Note that all the Apache projects are no longer here. It just took too long to check them out; the CVS client was blocking for hours at a time. If anyone's interested in this, I'll try to get this up and running on my cvs.apache.org account.</b>";
print "<p><b>1/31/03: The jakarta.apache.org and xml.apache.org projects have been moved <a href=\"http://cvs.apache.org/~tcopeland/pmdweb/\">here</a></b>";
print br();
open(FILE,"lastruntime.txt");
my $lastruntime=<FILE>;
close(FILE);
print br();
print "The last run finished at ", $lastruntime;
print hr();
if (param("location")) {
my $project = PMD::Project->new(param("location"),param("title"),param("unixname"), param("moduledirectory"), param("srcdir"));
if (param("unixname")) {
my $project = PMD::Project->new("Sourceforge",param("title"),param("unixname"), param("moduledirectory"), param("srcdir"));
addProject($project);
print p(), b("Added "), b($project->getTitle()), b(" to the schedule"), p();
}
@ -38,7 +44,6 @@ sub default() {
print "Want to run PMD on your Java Sourceforge project? Fill in the blanks and hit go:";
print start_form();
print "Project title (i.e., PMD): ", textfield(-name=>'title',-default=>'',-override=>1);
print br(), "Project location: ", radio_group(-name=>'location',-values=>['Sourceforge'],-default=>'Sourceforge',-override=>1);
print br(), "Project's Unix name (i.e., pmd): ", textfield(-name=>'unixname',-default=>'',-override=>1);
print br(), "Module directory (i.e., pmd-dcpd): ", textfield(-name=>'moduledirectory',-default=>'',-override=>1);
print br(), "Source directory (including module directory, i.e., pmd-dcpd/src): ", textfield(-name=>'srcdir',-default=>'',-override=>1);
@ -60,11 +65,6 @@ sub printStats() {
print br(), "Currently processing $currentjob";
}
#print br(), "There are ", getTimeUntil(), " minutes until the next scheduled run";
open(FILE,"lastruntime.txt");
my $lastruntime=<FILE>;
close(FILE);
print br();
print "The last run took ", sprintf("%.0f", $lastruntime/60), " minutes";
print br();
print "This report is regenerated every three hours at 10 minutes past the hour";
print br();