Added pctg column

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2476 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-12-16 19:07:34 +00:00
parent b9a3edb8f9
commit c36d66d83a

View File

@ -87,8 +87,11 @@ class Job
count = count == 0 ? 0 : (count/4).to_i
return count
end
def pctg
sprintf("%.2f", (pmd_lines.to_f/(ncss == 0 ? 1 : ncss.to_i))*100)
end
def to_s
return @location + ":" + @title + ":" + @unix_name +":"+@mod+":"+@src
@location + ":" + @title + ":" + @unix_name +":"+@mod+":"+@src
end
end
@ -122,7 +125,8 @@ if __FILE__ == $0
"title"=>fm["title.frag", {"file"=>j.reportFile, "title"=>j.title}],
"homepage"=>fm["homepage.frag", {"name"=>j.unix_name}],
"ncss"=>j.ncss,
"pmd"=>j.pmd_lines.to_s
"pmd"=>j.pmd_lines.to_s,
"pctg"=>j.pctg.to_s
}]
}
File.open("index.html", "w") {|f| f.syswrite(out)}