Clover coverage report - PMD - 3.7
Coverage timestamp: Wed May 31 2006 09:25:59 EDT

file stats: | LOC: | 37 |  | Methods: | 2
| NCLOC: | 33 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

SummaryHTMLRenderer.java

0%

0%

0%

0%

1 |  | package net.sourceforge.pmd.renderers;
2 |  |
3 |  | import net.sourceforge.pmd.PMD;
4 |  | import net.sourceforge.pmd.Report;
5 |  |
6 |  | import java.util.Iterator;
7 |  | import java.util.Map;
8 |  |
9 |  | public class SummaryHTMLRenderer extends AbstractRenderer implements Renderer {
10 | 0 | public String render(Report report) {
11 | 0 | StringBuffer buf = new StringBuffer("<html><head><title>PMD</title></head><body>" + PMD.EOL);
12 | 0 | buf.append(renderSummary(report));
13 | 0 | buf.append("<h2><center>Detail</h2></center>");
14 | 0 | buf.append("<table align=\"center\" cellspacing=\"0\" cellpadding=\"3\"><tr>" + PMD.EOL + "<th>#</th><th>File</th><th>Line</th><th>Problem</th></tr>" + PMD.EOL);
15 | 0 | buf.append(new HTMLRenderer().renderBody(report));
16 | 0 | buf.append("</table></body></html>");
17 | 0 | return buf.toString();
18 |  | }
19 |  |
20 | 0 | public String renderSummary(Report report) {
21 | 0 | StringBuffer buf = new StringBuffer();
22 | 0 | buf.append("<h2><center>Summary</h2></center>");
23 | 0 | buf.append("<table align=\"center\" cellspacing=\"0\" cellpadding=\"3\">");
24 | 0 | buf.append("<th>Rule name</th>");
25 | 0 | buf.append("<th>Number of violations</th>");
26 | 0 | Map summary = report.getSummary();
27 | 0 | for (Iterator i = summary.keySet().iterator(); i.hasNext();) {
28 | 0 | String ruleName = (String) i.next();
29 | 0 | buf.append("<tr>");
30 | 0 | buf.append("<td>" + ruleName + "</td>");
31 | 0 | buf.append("<td align=center>" + String.valueOf(((Integer) summary.get(ruleName)).intValue()) + "</td>");
32 | 0 | buf.append("</tr>");
33 |  | }
34 | 0 | buf.append("</table>");
35 | 0 | return buf.toString();
36 |  | }
37 |  | }