Browse Source

Temporary update to use the same style as log.xsl which is closer to

the Jakarta style. Those are the stylesheets used to generate reports for audit, metrics, coverage
recently sent to ant-dev


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271127 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
b5388a1350
3 changed files with 1293 additions and 737 deletions
  1. +177
    -84
      src/etc/coverage-frames.xsl
  2. +177
    -95
      src/etc/maudit-frames.xsl
  3. +939
    -558
      src/etc/mmetrics-frames.xsl

+ 177
- 84
src/etc/coverage-frames.xsl View File

@@ -1,3 +1,63 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">
<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />
<!--
The Apache Software License, Version 1.1

Copyright (c) 2001-2002 The Apache Software Foundation. All rights
reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

3. The end-user documentation included with the redistribution, if
any, must include the following acknowlegement:
"This product includes software developed by the
Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowlegement may appear in the software itself,
if and wherever such third-party acknowlegements normally appear.

4. The names "The Jakarta Project", "Ant", and "Apache Software
Foundation" must not be used to endorse or promote products derived
from this software without prior written permission. For written
permission, please contact apache@apache.org.

5. Products derived from this software may not be called "Apache"
nor may "Apache" appear in their names without prior written
permission of the Apache Group.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================

This software consists of voluntary contributions made by many
individuals on behalf of the Apache Software Foundation. For more
information on the Apache Software Foundation, please see
<http://www.apache.org/>.
-->

<!--
Sample stylesheet to be used with JProbe 3.0 XML output.
@@ -9,16 +69,9 @@
of a reference classpath so that you have the list of classes/methods
that are not used at all in a given classpath.
@author Stephane Bailliez <a href="sbailliez@imediation.com"/>
@author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">

<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />

<!-- default output directory is current directory -->
<xsl:param name="output.dir" select="'.'"/>
@@ -82,39 +135,57 @@
<!-- =======================================================================
Stylesheet CSS used
======================================================================= -->
<!-- this is the stylesheet css to use for nearly everything -->
<xsl:template name="stylesheet.css">
BODY {
font:normal 68% verdana,arial,helvetica;
color:#000000;
}
TD {
FONT-SIZE: 68%
}
TH {
FONT-SIZE: 68%;font-weight:bold;
}
P {
line-height:1.5em;
margin-top:0.5em; margin-bottom:1.0em;
}
H1 {
MARGIN: 0px 0px 5px; FONT: 165% verdana,arial,helvetica
}
H2 {
MARGIN-TOP: 1em; MARGIN-BOTTOM: 0.5em; FONT: bold 125% verdana,arial,helvetica
}
H3 {
MARGIN-BOTTOM: 0.5em; FONT: bold 115% verdana,arial,helvetica
}
H4 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
H5 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
H6 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
.bannercell {
border: 0px;
padding: 0px;
}
body {
margin-left: 10;
margin-right: 10;
font:normal 80% arial,helvetica,sanserif;
background-color:#FFFFFF;
color:#000000;
}
.a td {
background: #efefef;
}
.b td {
background: #fff;
}
th, td {
text-align: left;
vertical-align: top;
}
th {
font-weight:bold;
background: #ccc;
color: black;
}
table, th, td {
font-size:100%;
border: none
}
table.log tr td, tr th {
}
h2 {
font-weight:bold;
font-size:140%;
margin-bottom: 5;
}
h3 {
font-size:100%;
font-weight:bold;
background: #525D76;
color: white;
text-decoration: none;
padding: 5px;
margin-right: 2px;
margin-left: 2px;
margin-bottom: 0;
}
</xsl:template>

<!-- =======================================================================
@@ -128,7 +199,6 @@
</head>
<body>
<h2>Classes</h2>
<p>
<table width="100%">
<xsl:for-each select="package/class">
<xsl:sort select="@name"/>
@@ -145,7 +215,6 @@
</tr>
</xsl:for-each>
</table>
</p>
</body>
</html>
</xsl:template>
@@ -159,7 +228,6 @@
<body>
<h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
<h2>Packages</h2>
<p>
<table width="100%">
<xsl:for-each select="package">
<xsl:sort select="@name" order="ascending"/>
@@ -172,7 +240,6 @@
</tr>
</xsl:for-each>
</table>
</p>
</body>
</html>
</xsl:template>
@@ -185,24 +252,24 @@
</head>
<body onload="open('allclasses-frame.html','classListFrame')">
<xsl:call-template name="pageHeader"/>
<h2>Summary</h2>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<tr bgcolor="#A6CAF0" valign="top">
<th width="10%" nowrap="nowrap">Date</th>
<th width="10%" nowrap="nowrap">Elapsed time</th>
<h3>Summary</h3>
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<tr>
<!--th width="10%" nowrap="nowrap">Date</th>
<th width="10%" nowrap="nowrap">Elapsed time</th-->
<th width="10%" nowrap="nowrap">Reported Classes</th>
<th width="10%" nowrap="nowrap">Methods Hit</th>
<th width="10%" nowrap="nowrap">Lines Hit</th>
</tr>
<tr bgcolor="#EEEEE" valign="top">
<td nowrap="nowrap"><xsl:value-of select="execution_log/@program_start"/></td>
<td><xsl:value-of select="format-number(execution_log/@elapsed_time div 1000,'0.0')"/>secs</td>
<tr class="a">
<!--td nowrap="nowrap"><xsl:value-of select="execution_log/@program_start"/></td>
<td><xsl:value-of select="format-number(execution_log/@elapsed_time div 1000,'0.0')"/>secs</td-->
<td><xsl:value-of select="count(package/class)"/></td>
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
</tr>
</table>
<table border="0" width="95%">
<table border="0" width="100%">
<tr>
<td style="text-align: justify;">
To ensure accurate test runs on Java applications, developers need to know how much of
@@ -214,19 +281,21 @@
</tr>
</table>

<h2>Packages</h2>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<h3>Packages</h3>
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<xsl:apply-templates select="package[1]" mode="stats.header"/>
<!-- display packages and sort them via their coverage rate -->
<xsl:for-each select="package">
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><a href="{translate(@name,'.','/')}/package-summary.html"><xsl:value-of select="@name"/></a></td>
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
</tr>
</xsl:for-each>
</table>
<xsl:call-template name="pageFooter"/>
</body>
</html>
</xsl:template>
@@ -277,7 +346,6 @@
</table>
<H2>Classes</H2>
<p>
<TABLE WIDTH="100%">
<xsl:for-each select="class">
<xsl:sort select="@name"/>
@@ -288,7 +356,6 @@
</tr>
</xsl:for-each>
</TABLE>
</p>
</BODY>
</html>
</xsl:template>
@@ -304,24 +371,22 @@
<!-- when loading this package, it will open the classes into the frame -->
<BODY onload="open('package-frame.html','classListFrame')">
<xsl:call-template name="pageHeader"/>
<h3>Package <xsl:value-of select="@name"/></h3>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<h3>Package <xsl:value-of select="@name"/></h3>
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<xsl:apply-templates select="." mode="stats.header"/>
<xsl:apply-templates select="." mode="stats"/>
</table>
<xsl:if test="count(class) &gt; 0">
<H2>Classes</H2>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<H3>Classes</H3>
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<xsl:apply-templates select="." mode="stats.header"/>
<xsl:apply-templates select="class" mode="stats">
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
</xsl:apply-templates>
</table>
</p>
</xsl:if>
<xsl:call-template name="pageFooter"/>
</BODY>
</HTML>
</xsl:template>
@@ -340,41 +405,59 @@
<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>

<!-- class summary -->
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<xsl:apply-templates select="." mode="stats.header"/>
<xsl:apply-templates select="." mode="stats"/>
</table>
<!-- details of methods -->
<H2>Methods</H2>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<H3>Methods</H3>
<table class="log" cellpadding="5" cellspacing="2" width="100%">
<xsl:apply-templates select="method[1]" mode="stats.header"/>
<xsl:apply-templates select="method" mode="stats">
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/>
</xsl:apply-templates>
</table>
</p>
<xsl:call-template name="pageFooter"/>
</BODY>
</HTML>

</xsl:template>

<!-- Page HEADER -->
<!-- Page Header -->
<xsl:template name="pageHeader">
<h1>Coverage Results</h1>
<table width="100%">
<tr>
<td align="left"></td>
<td align="right">Designed for use with <a href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
</tr>
</table>
<!-- jakarta logo -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="bannercell" rowspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
</a>
</td>
<td style="text-align:right"><h2>Source Code Coverage</h2></td>
</tr>
<tr>
<td style="text-align:right">Designed for use with <a href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
</tr>
</table>
<hr size="1"/>
</xsl:template>

<!-- Page Footer -->
<xsl:template name="pageFooter">
<table width="100%">
<tr><td><hr noshade="yes" size="1"/></td></tr>
<tr><td>
<div align="center"><font color="#525D76" size="-1"><em>
Copyright &#169; 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</xsl:template>


<xsl:template name="table.header">
<tr bgcolor="#A6CAF0" valign="top">
<tr>
<th width="80%">Name</th>
<th width="10%" nowrap="nowrap">Methods Hit</th>
<th width="10%" nowrap="nowrap">Lines Hit</th>
@@ -382,13 +465,14 @@
</xsl:template>

<xsl:template match="method" mode="stats.header">
<tr bgcolor="#A6CAF0" valign="top">
<tr>
<th width="90%">Name</th>
<th width="10%" nowrap="nowrap">Lines Hit</th>
</tr>
</xsl:template>
<xsl:template match="method" mode="stats">
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><xsl:value-of select="@name"/></td>
<td>
<xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/>
@@ -397,14 +481,15 @@
</xsl:template>

<xsl:template match="package|class" mode="stats.header">
<tr bgcolor="#A6CAF0" valign="top">
<tr>
<th width="80%">Name</th>
<th width="10%" nowrap="nowrap">Methods Hit</th>
<th width="10%" nowrap="nowrap">Lines Hit</th>
</tr>
</xsl:template>
<xsl:template match="package|class" mode="stats">
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td>
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td>
@@ -435,6 +520,14 @@
<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
</xsl:template>

<!-- alternated row style -->
<xsl:template name="alternate-row">
<xsl:attribute name="class">
<xsl:if test="position() mod 2 = 1">a</xsl:if>
<xsl:if test="position() mod 2 = 0">b</xsl:if>
</xsl:attribute>
</xsl:template>

</xsl:stylesheet>



+ 177
- 95
src/etc/maudit-frames.xsl View File

@@ -2,32 +2,71 @@
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">

<!-- ======================================================================
<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />
<!--
The Apache Software License, Version 1.1

Copyright (c) 2001-2002 The Apache Software Foundation. All rights
reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

3. The end-user documentation included with the redistribution, if
any, must include the following acknowlegement:
"This product includes software developed by the
Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowlegement may appear in the software itself,
if and wherever such third-party acknowlegements normally appear.

4. The names "The Jakarta Project", "Ant", and "Apache Software
Foundation" must not be used to endorse or promote products derived
from this software without prior written permission. For written
permission, please contact apache@apache.org.

5. Products derived from this software may not be called "Apache"
nor may "Apache" appear in their names without prior written
permission of the Apache Group.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================

This software consists of voluntary contributions made by many
individuals on behalf of the Apache Software Foundation. For more
information on the Apache Software Foundation, please see
<http://www.apache.org/>.
-->
<!--

Stylesheet to transform an XML file generated by the Ant MAudit task into
a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
It use the Xalan redirect extension to write to multiple output files.
Note: HTML output can be made much more clean by removing non css attributes

====================================================================== -->
<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />

<!--
Xalan redirect extension writes relative file based on the parent directory
from the main output file, unfortunately, this is never set and you have
to do it yourself on the API. The code that does it in command line was
commented out in Xalan 1.2.2 :-(
Therefore I will use a stylesheet param for the output directory.
This has to be invoked as follows from the command line:
java -classpath bsf.jar;xalan.jar;xerces.jar org.apache.xalan.xslt.Process -IN maudit.xml -XSL maudit.xsl -PARAM output.dir './report'
@author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
-->

<xsl:param name="output.dir" select="'.'"/>


@@ -118,35 +157,55 @@

<!-- this is the stylesheet css to use for nearly everything -->
<xsl:template name="stylesheet.css">
BODY {
font:normal 68% verdana,arial,helvetica;
color:#000000;
}
TD {
FONT-SIZE: 68%
}
P {
line-height:1.5em;
margin-top:0.5em; margin-bottom:1.0em;
}
H1 {
MARGIN: 0px 0px 5px; FONT: 165% verdana,arial,helvetica
}
H2 {
MARGIN-TOP: 1em; MARGIN-BOTTOM: 0.5em; FONT: bold 125% verdana,arial,helvetica
}
H3 {
MARGIN-BOTTOM: 0.5em; FONT: bold 115% verdana,arial,helvetica
}
H4 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
H5 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
H6 {
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
}
.bannercell {
border: 0px;
padding: 0px;
}
body {
margin-left: 10;
margin-right: 10;
font:normal 80% arial,helvetica,sanserif;
background-color:#FFFFFF;
color:#000000;
}
.a td {
background: #efefef;
}
.b td {
background: #fff;
}
th, td {
text-align: left;
vertical-align: top;
}
th {
font-weight:bold;
background: #ccc;
color: black;
}
table, th, td {
font-size:100%;
border: none
}
table.log tr td, tr th {
}
h2 {
font-weight:bold;
font-size:140%;
margin-bottom: 5;
}
h3 {
font-size:100%;
font-weight:bold;
background: #525D76;
color: white;
text-decoration: none;
padding: 5px;
margin-right: 2px;
margin-left: 2px;
margin-bottom: 0;
}
</xsl:template>


@@ -160,25 +219,22 @@ H6 {
</xsl:call-template>
</HEAD>
<BODY>
<xsl:call-template name="pageHeader"/>
<xsl:call-template name="pageHeader"/>
<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3>

<table border="0" cellpadding="5" cellspacing="2" width="95%">
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<xsl:call-template name="class.audit.header"/>
<xsl:apply-templates select="." mode="print.audit"/>
</table>
<H2>Violations</H2>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<H3>Violations</H3>
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<xsl:call-template name="violation.audit.header"/>
<xsl:apply-templates select="./violation" mode="print.audit">
<xsl:sort data-type="number" select="@line"/>
</xsl:apply-templates>
</table>
</p>
<xsl:call-template name="pageFooter"/>
</BODY>
</HTML>
</xsl:template>
@@ -202,14 +258,12 @@ H6 {
</tr>
</table>
<H2>Classes</H2>
<p>
<h2>Classes</h2>
<TABLE WIDTH="100%">
<xsl:apply-templates select="/classes/class[./@package = $name]" mode="classes.list">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</TABLE>
</p>
</BODY>
</HTML>
</xsl:template>
@@ -237,13 +291,11 @@ H6 {
</head>
<body>
<h2>Classes</h2>
<p>
<table width="100%">
<xsl:apply-templates select=".//class" mode="all.classes">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</table>
</p>
</body>
</html>
</xsl:template>
@@ -281,13 +333,11 @@ H6 {
<body>
<h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
<h2>Packages</h2>
<p>
<table width="100%">
<xsl:apply-templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages">
<xsl:sort select="@package" order="ascending"/>
</xsl:apply-templates>
</table>
</p>
</body>
</html>
</xsl:template>
@@ -312,20 +362,20 @@ H6 {
</head>
<body onload="open('allclasses-frame.html','classListFrame')">
<xsl:call-template name="pageHeader"/>
<h2>Summary</h2>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<tr bgcolor="#A6CAF0" valign="top">
<td><b>Audited classes</b></td>
<td><b>Reported classes</b></td>
<td><b>Violations</b></td>
<h3>Summary</h3>
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<tr>
<th>Audited classes</th>
<th>Reported classes</th>
<th>Violations</th>
</tr>
<tr bgcolor="#EEEEE" valign="top">
<tr class="a">
<td><xsl:value-of select="@audited"/></td>
<td><xsl:value-of select="@reported"/></td>
<td><xsl:value-of select="@violations"/></td>
</tr>
</table>
<table border="0" width="95%">
<table border="0" width="100%">
<tr>
<td style="text-align: justify;">
Note: Rules checked have originated from style guidelines suggested by the language designers,
@@ -334,6 +384,8 @@ H6 {
and Metamata Audit rules (x.x).
Please consult these documents for additional information about violations.
<p/>
Rules checked also enforce adherence to <a href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun Java coding guidelines</a> in use at Jakarta.
<p/>
One should note that these violations do not necessary underline errors but should be used
as an indication for <i>possible</i> errors. As always, use your best judgment and review
them carefully, it might save you hours of debugging.
@@ -341,17 +393,19 @@ H6 {
</tr>
</table>

<h2>Packages</h2>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<h3>Packages</h3>
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<xsl:call-template name="class.audit.header"/>
<xsl:for-each select="class[not(./@package = preceding-sibling::class/@package)]">
<xsl:sort select="@package" order="ascending"/>
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td>
<td><xsl:value-of select="sum(/classes/class[./@package = current()/@package]/@violations)"/></td>
</tr>
</xsl:for-each>
</table>
<xsl:call-template name="pageFooter"/>
</body>
</html>
</xsl:template>
@@ -370,22 +424,21 @@ H6 {
<xsl:call-template name="pageHeader"/>
<h3>Package <xsl:value-of select="$name"/></h3>
<!--table border="0" cellpadding="5" cellspacing="2" width="95%">
<!--table border="0" cellpadding="5" cellspacing="2" width="100%">
<xsl:call-template name="class.metrics.header"/>
<xsl:apply-templates select="." mode="print.metrics"/>
</table-->
<xsl:if test="count(/classes/class[./@package = $name]) &gt; 0">
<H2>Classes</H2>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<H3>Classes</H3>
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<xsl:call-template name="class.audit.header"/>
<xsl:apply-templates select="/classes/class[./@package = $name]" mode="print.audit">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</table>
</p>
</xsl:if>
<xsl:call-template name="pageFooter"/>
</BODY>
</HTML>
</xsl:template>
@@ -415,51 +468,80 @@ H6 {
<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
</xsl:template>


<!-- Page HEADER -->
<xsl:template name="pageHeader">
<h1>Audit Results</h1>
<table width="100%">
<tr>
<td align="left"></td>
<td align="right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
</tr>
</table>

<!-- jakarta logo -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="bannercell" rowspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
</a>
</td>
<td style="text-align:right"><h2>Source Code Audit</h2></td>
</tr>
<tr>
<td style="text-align:right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
</tr>
</table>
<hr size="1"/>
</xsl:template>

<!-- Page HEADER -->
<xsl:template name="pageFooter">
<table width="100%">
<tr><td><hr noshade="yes" size="1"/></td></tr>
<tr><td>
<div align="center"><font color="#525D76" size="-1"><em>
Copyright &#169; 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</xsl:template>


<!-- class header -->
<xsl:template name="class.audit.header">
<tr bgcolor="#A6CAF0" valign="top">
<td width="80%"><b>Name</b></td>
<td><b>Violations</b></td>
<tr>
<th width="80%">Name</th>
<th>Violations</th>
</tr>
</xsl:template>

<!-- method header -->
<xsl:template name="violation.audit.header">
<tr bgcolor="#A6CAF0" valign="top">
<td><b>Line</b></td>
<td><b>Message</b></td>
<tr>
<th>Line</th>
<th>Message</th>
</tr>
</xsl:template>


<!-- class information -->
<xsl:template match="class" mode="print.audit">
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
<td><xsl:apply-templates select="@violations"/></td>
</tr>
</xsl:template>

<xsl:template match="violation" mode="print.audit">
<tr bgcolor="#EEEEE" valign="top">
<tr>
<xsl:call-template name="alternate-row"/>
<td><xsl:value-of select="@line"/></td>
<td><xsl:apply-templates select="@message"/></td>
</tr>
</xsl:template>

<!-- alternated row style -->
<xsl:template name="alternate-row">
<xsl:attribute name="class">
<xsl:if test="position() mod 2 = 1">a</xsl:if>
<xsl:if test="position() mod 2 = 0">b</xsl:if>
</xsl:attribute>
</xsl:template>

</xsl:stylesheet>

+ 939
- 558
src/etc/mmetrics-frames.xsl
File diff suppressed because it is too large
View File


Loading…
Cancel
Save