Inspired by bug #44958 - Record level support for Data Tables. (No formula parser...
[poi.git] / jdepend.xsl
blob4fd00012ba11da5394cf38baf80b92c99a4b1d30
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <!--
5 /* ====================================================================
6 Licensed to the Apache Software Foundation (ASF) under one or more
7 contributor license agreements. See the NOTICE file distributed with
8 this work for additional information regarding copyright ownership.
9 The ASF licenses this file to You under the Apache License, Version 2.0
10 (the "License"); you may not use this file except in compliance with
11 the License. You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 ==================================================================== */
21 -->
23 <xsl:output method="html" indent="yes"/>
25 <xsl:template match="JDepend">
26 <html>
27 <head>
28 <title>JDepend Analysis</title>
30 <style type="text/css">
31 body {
32 font:normal 68% verdana,arial,helvetica;
33 color:#000000;
35 table tr td, tr th {
36 font-size: 68%;
38 table.details tr th{
39 font-weight: bold;
40 text-align:left;
41 background:#a6caf0;
43 table.details tr td{
44 background:#eeeee0;
47 p {
48 line-height:1.5em;
49 margin-top:0.5em; margin-bottom:1.0em;
50 margin-left:2em;
51 margin-right:2em;
53 h1 {
54 margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
56 h2 {
57 margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
59 h3 {
60 margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
62 h4 {
63 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
65 h5 {
66 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
68 h6 {
69 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
71 .Error {
72 font-weight:bold; color:red;
74 .Failure {
75 font-weight:bold; color:purple;
77 .Properties {
78 text-align:right;
80 </style>
83 </head>
84 <body>
85 <!--h1>JDepend Report</h1>
86 <ul>
87 <xsl:for-each select="./Packages/Package">
88 <xsl:sort select="@name"/>
89 <li><xsl:value-of select="@name"/></li>
90 </xsl:for-each>
91 </ul-->
93 <h1><a name="top">JDepend Analysis</a></h1>
94 <p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</p>
95 <hr size="2" />
97 <table width="100%"><tr><td>
98 <a name="NVsummary"><h2>Summary</h2></a>
99 </td><td align="right">
100 [<a href="#NVsummary">summary</a>]
101 [<a href="#NVpackages">packages</a>]
102 [<a href="#NVcycles">cycles</a>]
103 [<a href="#NVexplanations">explanations</a>]
104 </td></tr></table>
106 <table width="100%" class="details">
107 <tr>
108 <th>Package</th>
109 <th>Total Classes</th>
110 <th><a href="#EXnumber">Abstract Classes</a></th>
111 <th><a href="#EXnumber">Concrete Classes</a></th>
112 <th><a href="#EXafferent">Afferent Couplings</a></th>
113 <th><a href="#EXefferent">Efferent Couplings</a></th>
114 <th><a href="#EXabstractness">Abstractness</a></th>
115 <th><a href="#EXinstability">Instability</a></th>
116 <th><a href="#EXdistance">Distance</a></th>
118 </tr>
119 <xsl:for-each select="./Packages/Package">
120 <xsl:if test="count(error) = 0">
121 <tr>
122 <td align="left">
124 <xsl:attribute name="href">#PK<xsl:value-of select="@name"/>
125 </xsl:attribute>
126 <xsl:value-of select="@name"/>
127 </a>
128 </td>
129 <td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
130 <td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
131 <td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
132 <td align="right"><xsl:value-of select="Stats/Ca"/></td>
133 <td align="right"><xsl:value-of select="Stats/Ce"/></td>
134 <td align="right"><xsl:value-of select="Stats/A"/></td>
135 <td align="right"><xsl:value-of select="Stats/I"/></td>
136 <td align="right"><xsl:value-of select="Stats/D"/></td>
139 </tr>
140 </xsl:if>
141 </xsl:for-each>
142 <xsl:for-each select="./Packages/Package">
143 <xsl:if test="count(error) &gt; 0">
144 <tr>
145 <td align="left">
146 <xsl:value-of select="@name"/>
147 </td>
148 <td align="left" colspan="8"><xsl:value-of select="error"/></td>
149 </tr>
150 </xsl:if>
151 </xsl:for-each>
152 </table>
154 <table width="100%"><tr><td>
155 <a name="NVpackages"><h2>Packages</h2></a>
156 </td><td align="right">
157 [<a href="#NVsummary">summary</a>]
158 [<a href="#NVpackages">packages</a>]
159 [<a href="#NVcycles">cycles</a>]
160 [<a href="#NVexplanations">explanations</a>]
161 </td></tr></table>
163 <xsl:for-each select="./Packages/Package">
164 <xsl:if test="count(error) = 0">
165 <h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
166 <xsl:value-of select="@name"/></a></h3>
168 <table width="100%"><tr>
169 <td><a href="#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
170 <td><a href="#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
171 <td><a href="#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
172 <td><a href="#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
173 <td><a href="#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
174 </tr></table>
176 <table width="100%" class="details">
177 <tr>
178 <th>Abstract Classes</th>
179 <th>Concrete Classes</th>
180 <th>Used by Packages</th>
181 <th>Uses Packages</th>
182 </tr>
183 <tr>
184 <td valign="top" width="25%">
185 <xsl:if test="count(AbstractClasses/Class)=0">
186 <i>None</i>
187 </xsl:if>
188 <xsl:for-each select="AbstractClasses/Class">
189 <xsl:value-of select="node()"/><br/>
190 </xsl:for-each>
191 </td>
192 <td valign="top" width="25%">
193 <xsl:if test="count(ConcreteClasses/Class)=0">
194 <i>None</i>
195 </xsl:if>
196 <xsl:for-each select="ConcreteClasses/Class">
197 <xsl:value-of select="node()"/><br/>
198 </xsl:for-each>
199 </td>
200 <td valign="top" width="25%">
201 <xsl:if test="count(UsedBy/Package)=0">
202 <i>None</i>
203 </xsl:if>
204 <xsl:for-each select="UsedBy/Package">
206 <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
207 <xsl:value-of select="node()"/>
208 </a><br/>
209 </xsl:for-each>
210 </td>
211 <td valign="top" width="25%">
212 <xsl:if test="count(DependsUpon/Package)=0">
213 <i>None</i>
214 </xsl:if>
215 <xsl:for-each select="DependsUpon/Package">
217 <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
218 <xsl:value-of select="node()"/>
219 </a><br/>
220 </xsl:for-each>
221 </td>
222 </tr>
223 </table>
224 </xsl:if>
225 </xsl:for-each>
227 <table width="100%"><tr><td>
228 <a name="NVcycles"><h2>Cycles</h2></a>
229 </td><td align="right">
230 [<a href="#NVsummary">summary</a>]
231 [<a href="#NVpackages">packages</a>]
232 [<a href="#NVcycles">cycles</a>]
233 [<a href="#NVexplanations">explanations</a>]
234 </td></tr></table>
236 <xsl:if test="count(Cycles/Package) = 0">
237 <p>There are no cyclic dependancies.</p>
238 </xsl:if>
239 <xsl:for-each select="Cycles/Package">
240 <h3><xsl:value-of select="@Name"/></h3><p>
241 <xsl:for-each select="Package">
242 <xsl:value-of select="."/><br/>
243 </xsl:for-each></p>
244 </xsl:for-each>
246 <table width="100%"><tr><td>
247 <a name="NVexplanations"><h2>Explanations</h2></a>
248 </td><td align="right">
249 [<a href="#NVsummary">summary</a>]
250 [<a href="#NVpackages">packages</a>]
251 [<a href="#NVcycles">cycles</a>]
252 [<a href="#NVexplanations">explanations</a>]
253 </td></tr></table>
255 <p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
257 <h3><a name="EXnumber">Number of Classes</a></h3>
258 <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
259 <h3><a name="EXafferent">Afferent Couplings</a></h3>
260 <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
261 <h3><a name="EXefferent">Efferent Couplings</a></h3>
262 <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
263 <h3><a name="EXabstractness">Abstractness</a></h3>
264 <p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
265 <p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
266 <h3><a name="EXinstability">Instability</a></h3>
267 <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
268 <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
269 <h3><a name="EXdistance">Distance</a></h3>
270 <p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
271 <p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
272 <p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
274 </body>
275 </html>
276 </xsl:template>
278 </xsl:stylesheet>