Rename pmd -> pmd-core and pmd-aggregate -> pmd

This commit is contained in:
Andreas Dangel
2014-10-08 22:52:25 +02:00
parent 38dd43a16b
commit f748539c45
476 changed files with 40 additions and 40 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 1">p1</xsl:if>
<xsl:if test="@priority = 2">p2</xsl:if>
<xsl:if test="@priority = 3">p3</xsl:if>
<xsl:if test="@priority = 4">p4</xsl:if>
<xsl:if test="@priority = 5">p5</xsl:if>
<xsl:if test="@priority = 6">p6</xsl:if>
<xsl:if test="@priority = 7">p7</xsl:if>
<xsl:if test="@priority = 8">p8</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF3300; }
.p2 { background:#FF9966; }
.p3 { background:#FFCC33; }
.p4 { background:#FFFF00; }
.p5 { background:#FFFFCC; }
.p6 { background:#CCFFCC; }
.p7 { background:#66FF66; }
.p8 { background:#00FF00; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>QRank Level 1</th>
<th>QRank Level 2</th>
<th>QRank Level 3</th>
<th>QRank Level 4</th>
<th>QRank Level 5</th>
<th>QRank Level 6</th>
<th>QRank Level 7</th>
<th>QRank Level 8</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
<td><div class="p3"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
<td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
<td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
<td><div class="p6"><xsl:value-of select="count(//violation[@priority = 6])"/></div></td>
<td><div class="p7"><xsl:value-of select="count(//violation[@priority = 7])"/></div></td>
<td><div class="p8"><xsl:value-of select="count(//violation[@priority = 8])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file">
<xsl:sort data-type="number" order="descending" select="count(violation)"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation)"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Stylesheet to turn the XML output of CPD into a nice-looking HTML page -->
<!-- $Id$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template match="pmd-cpd">
<html>
<head>
<script type="text/javascript">
function toggleCodeSection(btn, id)
{
area = document.getElementById(id);
if (area.style.display == 'none')
{
btn.innerHTML = '-';
area.style.display = 'inline';
}
else
{
btn.innerHTML = '+';
area.style.display = 'none';
}
}
</script>
<style>
.SummaryTitle { }
.SummaryNumber { background-color:#DDDDDD; text-align: center; }
.ItemNumber { background-color: #DDDDDD; }
.CodeFragment { background-color: #BBBBBB; display:none; font:normal normal normal 9pt Courier; }
.ExpandButton { background-color: #FFFFFF; font-size: 8pt; width: 20px; height: 20px; margin:0px; }
</style>
</head>
<body>
<h2>Summary of duplicated code</h2>
This page summarizes the code fragments that have been found to be replicated in the code.
Only those fragments longer than 30 lines of code are shown.
<p/>
<table border="1" class="summary" cellpadding="2">
<tr style="background-color:#CCCCCC;">
<th># duplications</th>
<th>Total lines</th>
<th>Total tokens</th>
<th>Approx # bytes</th>
</tr>
<tr>
<td class="SummaryNumber"><xsl:value-of select="count(//duplication[@lines>30])"/></td>
<td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@lines)"/></td>
<td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@tokens)"/></td>
<td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@tokens) * 4"/></td>
</tr>
</table>
<p/>
You expand and collapse the code fragments using the + buttons. You can also navigate to the source code by clicking
on the file names.
<p/>
<table>
<tr style="background-color: #444444; color: #DDDDDD;"><td>ID</td><td>Files</td><td>Lines</td></tr>
<xsl:for-each select="//duplication[@lines>30]">
<xsl:sort data-type="number" order="descending" select="@lines"/>
<tr>
<td class="ItemNumber"><xsl:value-of select="position()"/></td>
<td>
<table>
<xsl:for-each select="file">
<tr><td><a><xsl:attribute name="href">../src/<xsl:value-of select="@path"/>.html#<xsl:value-of select="@line"/></xsl:attribute><xsl:value-of select="@path"/></a></td><td> line <xsl:value-of select="@line"/></td></tr>
</xsl:for-each>
</table>
</td>
<td># lines : <xsl:value-of select="@lines"/></td>
</tr>
<tr>
<td> </td>
<td colspan="2" valign="top">
<table><tr>
<td valign="top">
<button class="ExpandButton" ><xsl:attribute name="onclick">blur(); toggleCodeSection(this, 'frag_<xsl:value-of select="position()"/>')</xsl:attribute>+</button>
</td>
<td>
<textarea cols="100" rows="30" wrap="off" class='CodeFragment' style='display:none;'>
<xsl:attribute name="id">frag_<xsl:value-of select="position()"/></xsl:attribute>
<xsl:value-of select="codefragment"/>
</textarea>
</td>
</tr></table>
</td>
</tr>
<tr><td colspan="2"><hr/></td></tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,75 @@
body{
font-family:Arial,Sans-Serif;
font-size:90%;
background:#cc9;
}
#boundary{
background:#f8f8f8;
padding:2em;
width:40em;
}
h1{
font-family:"Trebuchet MS",Sans-serif;
text-transform:uppercase;
color:#696;
font-size:120%;
}
table.footcollapse{
width:100%;
}
table.footcollapse caption{
font-size:120%;
text-transform:uppercase;
text-align:left;
padding:.5em 1em;
}
table.footcollapse th{
text-align:left;
}
table.footcollapse,table.footcollapse th,table.footcollapse th
{
border:none;
border-collapse:collapse;
}
table.footcollapse thead th
{
width:10em;
border-style:solid;
border-width:1px;
border-color:#cff #69c #69c #cff;
background:#9cf;
padding:2px 10px;
}
table.footcollapse tfoot th,
table.footcollapse tfoot td
{
border-style:solid;
border-width:1px;
border-color:#9cf #369 #369 #9cf;
background:#69c;
padding:2px 10px;
}
table.footcollapse tbody{
background:#ddd;
}
table.footcollapse tbody td{
padding:5px 10px;
border:1px solid #999;
}
table.footcollapse tbody th{
padding:2px 10px;
border:1px solid #999;
border-left:none;
}
table.footcollapse tbody tr.odd{
background:#ccc;
}
table.footcollapse tfoot td img{
border:none;
vertical-align:bottom;
padding-left:10px;
float:right;
}

View File

@ -0,0 +1,57 @@
function tablecollapse()
{
/* Variables */
var collapseClass='footcollapse';
var collapsePic='arrow_up.gif';
var expandPic='arrow_down.gif';
var initialCollapse=true;
// loop through all tables
var t=document.getElementsByTagName('table');
var checktest= new RegExp("(^|\\s)" + collapseClass + "(\\s|$)");
for (var i=0;i<t.length;i++)
{
// if the table has not the right class, skip it
if(!checktest.test(t[i].className)){continue;}
// make the footer clickable
t[i].getElementsByTagName('tfoot')[0].onclick=function()
{
// loop through all bodies of this table and show or hide
// them
var tb=this.parentNode.getElementsByTagName('tbody');
for(var i=0;i<tb.length;i++)
{
tb[i].style.display=tb[i].style.display=='none'?'':'none';
}
// change the image accordingly
var li=this.getElementsByTagName('img')[0];
li.src=li.src.indexOf(collapsePic)==-1?collapsePic:expandPic;
}
// if the bodies should be collapsed initially, do so
if(initialCollapse)
{
var tb=t[i].getElementsByTagName('tbody');
for(var j=0;j<tb.length;j++)
{
tb[j].style.display='none';
}
}
// add the image surrounded by a dummy link to allow keyboard
// access to the last cell in the footer
var newa=document.createElement('a');
newa.href='#';
newa.onclick=function(){return false;}
var newimg=document.createElement('img');
newimg.src=initialCollapse?expandPic:collapsePic;
var tf=t[i].getElementsByTagName('tfoot')[0];
var lt=tf.getElementsByTagName('td')[tf.getElementsByTagName('td').length-1];
newa.appendChild(newimg);
lt.insertBefore(newa,lt.firstChild);
}
}
// run tablecollapse when the page loads
window.onload=tablecollapse;

View File

@ -0,0 +1,22 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="testsuites">
Junit test results
<xsl:for-each select="testsuite[(@failures + @errors) &gt; 0]">
Test suite <xsl:value-of select="@name"/> failed (failures: <xsl:value-of select="@failures"/>, errors: <xsl:value-of select="@errors"/>)
<xsl:for-each select="testcase[(count(error) + count(failure)) &gt; 0]">
Test case <xsl:value-of select="@name"/> failed (failures: <xsl:value-of select="count(failure)"/>, errors: <xsl:value-of select="count(error)"/>)
<xsl:for-each select="failure">
failure: <xsl:value-of select="@message"/>.
</xsl:for-each>
<xsl:for-each select="error">
error: <xsl:value-of select="@message"/>.
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
Summary: <xsl:value-of select="count(//testcase)"/> tests
failures: <xsl:value-of select="count(//failure)"/>, errors: <xsl:value-of select="count(//error)"/>.
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 1">p1</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 1</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file[violation/@priority=1]">
<xsl:sort data-type="number" order="descending" select="count(violation[@priority = 1])"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation[@priority = 1])"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation[@priority = '1']">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 2">p2</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 2</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file[violation/@priority=2]">
<xsl:sort data-type="number" order="descending" select="count(violation[@priority = 2])"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation[@priority = 2])"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation[@priority = '2']">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 3">p3</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 3</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file[violation/@priority=3]">
<xsl:sort data-type="number" order="descending" select="count(violation[@priority = 3])"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation[@priority = 3])"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation[@priority = '3']">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 4">p4</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 4</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file[violation/@priority=4]">
<xsl:sort data-type="number" order="descending" select="count(violation[@priority = 4])"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation[@priority = 4])"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation[@priority = '4']">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 5">p5</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="fcoltable.js"></script>
<style type="text/css">
@import "fcoltable.css";
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 5</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file[violation/@priority=4]">
<xsl:sort data-type="number" order="descending" select="count(violation[@priority = 5])"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="footcollapse"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<thead>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Total number of violations for this class: <xsl:value-of select="count(violation[@priority = 5])"/> (Click anywhere on this row to see/hide details)</th>
<td></td>
</tr>
</tfoot>
<xsl:for-each select="violation[@priority = '5']">
<tbody>
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</tbody>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 1">p1</xsl:if>
<xsl:if test="@priority = 2">p2</xsl:if>
<xsl:if test="@priority = 3">p3</xsl:if>
<xsl:if test="@priority = 4">p4</xsl:if>
<xsl:if test="@priority = 5">p5</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="sorttable.js"></script>
<style type="text/css">
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 1</th>
<th>Priority 2</th>
<th>Priority 3</th>
<th>Priority 4</th>
<th>Priority 5</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
<td><div class="p3"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
<td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
<td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file">
<xsl:sort data-type="number" order="descending" select="count(violation)"/>
<xsl:variable name="filename" select="@name"/>
<h3><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(@name,'.java'),'/','.')"/></h3>
<table border="0" width="100%" class="sortable"><xsl:attribute name="id">sortable_id_<xsl:value-of select="position()"/></xsl:attribute>
<tr>
<th>Prio</th>
<th>Begin Line</th>
<th>Method</th>
<th align="left">Description</th>
</tr>
<xsl:for-each select="violation">
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="@method"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</xsl:for-each>
</table>
<table border="0" width="100%" class="classcount">
<tr>
<th>Total number of violations for this class: <xsl:value-of select="count(violation)"/></th>
</tr>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="cvsweb">http://doc.ece.uci.edu/cvs/viewcvs.cgi/Zen/packages/src/</xsl:variable>
<xsl:template match="pmd">
<html>
<head>
<title>PMD Report</title>
<style type="text/css">
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.details tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.details tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
</style>
</head>
<body>
<H1>PMD Report</H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 1</th>
<th>Priority 2</th>
<th>Priority 3</th>
<th>Priority 4</th>
<th>Priority 5</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
<td><div class="p3"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
<td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
<td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
</tr>
</table>
<hr/>
<xsl:for-each select="file">
<xsl:sort data-type="number" order="descending" select="count(violation)"/>
<xsl:variable name="filename" select="@name"/>
<H3><xsl:value-of disable-output-escaping="yes" select="substring-before(translate(@name,'/','.'),'.java')"/></H3>
<table border="0" width="100%" class="details">
<tr>
<th>Begin Line</th>
<th align="left">Description</th>
</tr>
<xsl:for-each select="violation">
<tr>
<td style="padding: 3px" align="right"><a><xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$filename"/>?annotate=HEAD#<xsl:value-of disable-output-escaping="yes" select="@beginline"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@beginline"/></a></td>
<td style="padding: 3px" align="left" width="100%"><xsl:value-of disable-output-escaping="yes" select="."/></td>
</tr>
</xsl:for-each>
</table>
<br/>
</xsl:for-each>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:value-of select="//pmd/@timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='2']"/>
<xsl:template match="pmd/file/violation[@priority='3']"/>
<xsl:template match="pmd/file/violation[@priority='4']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='1']"/>
<xsl:template match="pmd/file/violation[@priority='3']"/>
<xsl:template match="pmd/file/violation[@priority='4']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='1']"/>
<xsl:template match="pmd/file/violation[@priority='2']"/>
<xsl:template match="pmd/file/violation[@priority='4']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='1']"/>
<xsl:template match="pmd/file/violation[@priority='2']"/>
<xsl:template match="pmd/file/violation[@priority='3']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='1']"/>
<xsl:template match="pmd/file/violation[@priority='2']"/>
<xsl:template match="pmd/file/violation[@priority='3']"/>
<xsl:template match="pmd/file/violation[@priority='4']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='3']"/>
<xsl:template match="pmd/file/violation[@priority='4']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='4']"/>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pmd/file/violation[@priority='5']"/>
</xsl:stylesheet>

View File

@ -0,0 +1,184 @@
//$Header$
addEvent(window, "load", sortables_init);
var SORT_COLUMN_INDEX;
function sortables_init() {
// Find all tables with class sortable and make them sortable
if (!document.getElementsByTagName) return;
tbls = document.getElementsByTagName("table");
for (ti=0;ti<tbls.length;ti++) {
thisTbl = tbls[ti];
if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
//initTable(thisTbl.id);
ts_makeSortable(thisTbl);
}
}
}
function ts_makeSortable(table) {
if (table.rows && table.rows.length > 0) {
var firstRow = table.rows[0];
}
if (!firstRow) return;
// We have a first row: assume it's the header, and make its contents clickable links
for (var i=0;i<firstRow.cells.length;i++) {
var cell = firstRow.cells[i];
var txt = ts_getInnerText(cell);
cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';
}
}
function ts_getInnerText(el) {
if (typeof el == "string") return el;
if (typeof el == "undefined") { return el };
if (el.innerText) return el.innerText; //Not needed but it is faster
var str = "";
var cs = el.childNodes;
var l = cs.length;
for (var i = 0; i < l; i++) {
switch (cs[i].nodeType) {
case 1: //ELEMENT_NODE
str += ts_getInnerText(cs[i]);
break;
case 3: //TEXT_NODE
str += cs[i].nodeValue;
break;
}
}
return str;
}
function ts_resortTable(lnk) {
// get the span
var span;
for (var ci=0;ci<lnk.childNodes.length;ci++) {
if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
}
var spantext = ts_getInnerText(span);
var td = lnk.parentNode;
var column = td.cellIndex;
var table = getParent(td,'TABLE');
// Work out a type for the column
if (table.rows.length <= 1) return;
var itm = ts_getInnerText(table.rows[1].cells[column]);
sortfn = ts_sort_caseinsensitive;
if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) sortfn = ts_sort_date;
if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) sortfn = ts_sort_date;
if (itm.match(/^[<5B>$]/)) sortfn = ts_sort_currency;
if (itm.match(/^[\d\.]+$/)) sortfn = ts_sort_numeric;
SORT_COLUMN_INDEX = column;
var firstRow = new Array();
var newRows = new Array();
for (i=0;i<table.rows[0].length;i++) { firstRow[i] = table.rows[0][i]; }
for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }
newRows.sort(sortfn);
if (span.getAttribute("sortdir") == 'down') {
ARROW = '&nbsp;&nbsp;&uarr;';
newRows.reverse();
span.setAttribute('sortdir','up');
} else {
ARROW = '&nbsp;&nbsp;&darr;';
span.setAttribute('sortdir','down');
}
// We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
// don't do sortbottom rows
for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
// do sortbottom rows only
for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
// Delete any other arrows there may be showing
var allspans = document.getElementsByTagName("span");
for (var ci=0;ci<allspans.length;ci++) {
if (allspans[ci].className == 'sortarrow') {
if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';
}
}
}
span.innerHTML = ARROW;
}
function getParent(el, pTagName) {
if (el == null) return null;
else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase
return el;
else
return getParent(el.parentNode, pTagName);
}
function ts_sort_date(a,b) {
// y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
if (aa.length == 10) {
dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);
} else {
yr = aa.substr(6,2);
if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
dt1 = yr+aa.substr(3,2)+aa.substr(0,2);
}
if (bb.length == 10) {
dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);
} else {
yr = bb.substr(6,2);
if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
dt2 = yr+bb.substr(3,2)+bb.substr(0,2);
}
if (dt1==dt2) return 0;
if (dt1<dt2) return -1;
return 1;
}
function ts_sort_currency(a,b) {
aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
return parseFloat(aa) - parseFloat(bb);
}
function ts_sort_numeric(a,b) {
aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
if (isNaN(aa)) aa = 0;
bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));
if (isNaN(bb)) bb = 0;
return aa-bb;
}
function ts_sort_caseinsensitive(a,b) {
aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
if (aa==bb) return 0;
if (aa<bb) return -1;
return 1;
}
function ts_sort_default(a,b) {
aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
if (aa==bb) return 0;
if (aa<bb) return -1;
return 1;
}
function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+, NS6 and Mozilla
// By Scott Andrew
{
if (elm.addEventListener){
elm.addEventListener(evType, fn, useCapture);
return true;
} else if (elm.attachEvent){
var r = elm.attachEvent("on"+evType, fn);
return r;
} else {
alert("Handler could not be removed");
}
}

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
<xsl:template name="message">
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:template>
<xsl:template name="priorityDiv">
<xsl:if test="@priority = 1">p1</xsl:if>
<xsl:if test="@priority = 2">p2</xsl:if>
<xsl:if test="@priority = 3">p3</xsl:if>
<xsl:if test="@priority = 4">p4</xsl:if>
<xsl:if test="@priority = 5">p5</xsl:if>
</xsl:template>
<xsl:template name="timestamp">
<xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
</xsl:template>
<xsl:template match="pmd">
<html>
<head>
<title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
<script type="text/javascript" src="sorttable.js"></script>
<style type="text/css">
body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.sortable tr td { background:#eeeee0; }
table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.classcount tr td { background:#eeeee0; }
table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
table.summary tr td { background:#eeeee0; text-align:center;}
.p1 { background:#FF9999; }
.p2 { background:#FFCC66; }
.p3 { background:#FFFF99; }
.p4 { background:#99FF99; }
.p5 { background:#9999FF; }
div.top{text-align:right;margin:1em 0;padding:0}
div.top div{display:inline;white-space:nowrap}
div.top div.left{float:left}
#content>div.top{display:table;width:100%}
#content>div.top div{display:table-cell}
#content>div.top div.left{float:none;text-align:left}
#content>div.top div.right{text-align:right}
</style>
</head>
<body>
<H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
<hr/>
<h2>Summary</h2>
<table border="0" class="summary">
<tr>
<th>Files</th>
<th>Total</th>
<th>Priority 1</th>
<th>Priority 2</th>
<th>Priority 3</th>
<th>Priority 4</th>
<th>Priority 5</th>
</tr>
<tr>
<td><xsl:value-of select="count(//file)"/></td>
<td><xsl:value-of select="count(//violation)"/></td>
<td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
<td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
<td><div class="p3"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
<td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
<td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
</tr>
</table>
<hr/>
<table border="0" width="100%" class="sortable" id="sortable_id">
<tr>
<th>Prio</th>
<th>File</th>
<th>Line</th>
<th align="left">Description</th>
</tr>
<xsl:for-each select="file">
<xsl:for-each select="violation">
<tr>
<td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
<td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(../@name,'.java'),'/','.')"/></td>
<td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
<td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
<br/>
<p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>