PageRenderTime 54ms CodeModel.GetById 30ms app.highlight 6ms RepoModel.GetById 14ms app.codeStats 1ms

/tools/StyleCop/StyleCopReport.xsl

http://github.com/agross/netopenspace
Extensible Stylesheet Language Transformations | 325 lines | 324 code | 1 blank | 0 comment | 0 complexity | 2359e421426dfcbaff9f65485700ff19 MD5 | raw file
  1<?xml version="1.0" encoding="UTF-8"?>
  2<!--Designed and generated by Altova StyleVision Enterprise Edition 2008 rel. 2 sp2 - see http://www.altova.com/stylevision for more information.-->
  3<xsl:stylesheet version="2.0"
  4				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5				xmlns:mstns="http://stylecopcmd.sourceforge.net/StyleCopReport.xsd"
  6				xmlns:xs="http://www.w3.org/2001/XMLSchema"
  7				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  8				exclude-result-prefixes="mstns xs xsi">
  9	<xsl:output version="4.0"
 10				method="html"
 11				indent="yes"
 12				encoding="UTF-8"
 13				doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
 14				doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
 15	<xsl:param name="SV_OutputFormat"
 16			   select="'HTML'" />
 17	<xsl:template match="/">
 18		<html>
 19			<head>
 20				<title>StyleCop Report</title>
 21				<style type="text/css">
 22					body {
 23					font-family: Segoe UI, Verdana, Tahoma, Sans-Serif;
 24					font-size: .8em;
 25					}
 26					.violation, .value, code {
 27					color: #C60A0A;
 28					}
 29					h3 {
 30					color: navy;
 31					}
 32					table {
 33					width: 100%;
 34					border: none;
 35					}
 36					.expand{
 37					cursor: pointer;
 38					}
 39					td {
 40					padding: .2em;
 41					}
 42					.violation {
 43					width: 80px;
 44					}
 45					.name {
 46					width: 250px;
 47					}
 48					.line {
 49					width: 50px;
 50					}
 51					.subitem {
 52					display: none;
 53					margin-left: 1em;
 54					}
 55					.label {
 56					font-weight: bold;
 57					}
 58					tr.level1 {background-color: #f0f0f0;}
 59					tr.level2 {background-color: #e1e1e1;}
 60					tr.level3 {background-color: #d2d2d2;}
 61					tr.level4 {background-color: silver;}
 62					table.level5 {background-color: #dee7ec;}
 63					code {
 64					display: block;
 65					padding: 1em 0.3em;
 66					background-color: #ffffe9;
 67					font-size: 1.2em;
 68					}
 69				</style>
 70				<script type="text/javascript">
 71					//{concat(concat(&quot;var el = document.getElementById(&apos;solution&quot;, mstns:ID), &quot;&apos;);
 72					function toggleExpand(element)
 73					{
 74					el = document.getElementById(element);
 75					if (!el)
 76					{
 77					return;
 78					}
 79
 80					if (el.style.display=='block')
 81					{
 82					el.style.display='none';
 83					}
 84					else
 85					{
 86					el.style.display='block';
 87					}
 88					}
 89				</script>
 90			</head>
 91			<body>
 92				<xsl:for-each select="/">
 93					<h3>
 94						<xsl:text>StyleCop Report</xsl:text>
 95					</h3>
 96					<ul id="summary">
 97						<li>
 98							<span class="label">
 99								<xsl:text>Total Solutions: </xsl:text>
100							</span>
101							<span class="value">
102								<xsl:value-of select="count(mstns:StyleCopReport/mstns:Solutions)" />
103							</span>
104						</li>
105						<li>
106							<span class="label">
107								<xsl:text>Total Source Files: </xsl:text>
108							</span>
109							<span class="value">
110								<xsl:value-of select="count(//mstns:SourceCodeFiles)" />
111							</span>
112						</li>
113						<li>
114							<span class="label">
115								<xsl:text>Total Number of Violations: </xsl:text>
116							</span>
117							<span class="value">
118								<xsl:value-of select="count(//mstns:Violations)" />
119							</span>
120						</li>
121					</ul>
122					<table>
123						<tbody>
124							<tr>
125								<td class="violation">
126									<xsl:text>Violations</xsl:text>
127								</td>
128								<td class="name">
129									<xsl:text>Solution Name</xsl:text>
130								</td>
131								<td>
132									<xsl:text>Path</xsl:text>
133								</td>
134							</tr>
135						</tbody>
136					</table>
137					<xsl:for-each select="mstns:StyleCopReport">
138						<xsl:for-each select="mstns:Solutions">
139							<table class="expand">
140								<tbody onclick="toggleExpand('{concat('solution', mstns:ID)}')">
141									<tr class="level1">
142										<td class="violation">
143											<xsl:value-of select="count(mstns:Projects/mstns:SourceCodeFiles/mstns:Violations)" />
144										</td>
145										<td class="name">
146											<xsl:for-each select="mstns:Name">
147												<xsl:apply-templates />
148											</xsl:for-each>
149										</td>
150										<td>
151											<xsl:for-each select="mstns:Location">
152												<xsl:apply-templates />
153											</xsl:for-each>
154										</td>
155									</tr>
156								</tbody>
157							</table>
158							<div class="subitem"
159								 id='{concat("solution", mstns:ID)}'>
160								<xsl:for-each select="mstns:Projects">
161									<table>
162										<tbody>
163											<tr>
164												<td class="violation">
165													<xsl:text>Violations</xsl:text>
166												</td>
167												<td class="name">
168													<xsl:text>Project Name</xsl:text>
169												</td>
170												<td>
171													<xsl:text>Path</xsl:text>
172												</td>
173											</tr>
174										</tbody>
175									</table>
176									<table class="expand">
177										<tbody onclick="toggleExpand('{concat('project', mstns:ID)}')">
178											<tr class="level2">
179												<td class="violation">
180													<xsl:value-of select="count(mstns:SourceCodeFiles/mstns:Violations)" />
181												</td>
182												<td class="name">
183													<xsl:for-each select="mstns:Name">
184														<xsl:apply-templates />
185													</xsl:for-each>
186												</td>
187												<td>
188													<xsl:for-each select="mstns:Location">
189														<xsl:apply-templates />
190													</xsl:for-each>
191												</td>
192											</tr>
193										</tbody>
194									</table>
195									<div class="subitem"
196										 id='{concat("project", mstns:ID )}'>
197										<table>
198											<tbody>
199												<tr>
200													<td class="violation">
201														<xsl:text>Violations</xsl:text>
202													</td>
203													<td class="name">
204														<xsl:text>Name</xsl:text>
205													</td>
206													<td>
207														<xsl:text>Path</xsl:text>
208													</td>
209												</tr>
210											</tbody>
211										</table>
212										<xsl:for-each select="mstns:SourceCodeFiles">
213											<xsl:if test="count(mstns:Violations) &gt; 0">
214												<table class="expand">
215													<tbody onclick="toggleExpand('{concat('files', mstns:ID)}')">
216														<tr class="level3">
217															<td class="violation">
218																<xsl:value-of select="count(mstns:Violations)" />
219															</td>
220															<td class="name">
221																<xsl:for-each select="mstns:Name">
222																	<xsl:apply-templates />
223																</xsl:for-each>
224															</td>
225															<td>
226																<xsl:for-each select="mstns:Path">
227																	<xsl:apply-templates />
228																</xsl:for-each>
229															</td>
230														</tr>
231													</tbody>
232												</table>
233												<div class="subitem"
234													 id='{concat("files", mstns:ID )}'>
235													<table>
236														<tbody>
237															<tr>
238																<td class="violation">
239																	<xsl:text>Rule</xsl:text>
240																</td>
241																<td>
242																	<xsl:text>Description</xsl:text>
243																</td>
244																<td class="line">
245																	<xsl:text>Line</xsl:text>
246																</td>
247															</tr>
248														</tbody>
249													</table>
250													<xsl:for-each select="mstns:Violations">
251														<xsl:for-each select="mstns:Rules">
252															<table class="expand"
253																   onclick="toggleExpand('line{concat(mstns:CheckId, ../mstns:ID)}'); toggleExpand('{concat(mstns:CheckId, ../mstns:ID)}');">
254																<tbody>
255																	<tr class="level4">
256																		<td class="violation">
257																			<xsl:for-each select="mstns:CheckId">
258																				<xsl:apply-templates />
259																			</xsl:for-each>
260																		</td>
261																		<td>
262																			<xsl:value-of select="../mstns:Message" />
263																		</td>
264																		<td class="line">
265																			<xsl:value-of select="../mstns:Line" />
266																		</td>
267																	</tr>
268																</tbody>
269															</table>
270															<div class="subitem"
271																 id="line{concat(mstns:CheckId, ../mstns:ID)}">
272																<code>
273																	<xsl:value-of select="../mstns:SourceCodeLine" />
274																</code>
275															</div>
276															<table class="subitem level5"
277																   id="{concat(mstns:CheckId, ../mstns:ID)}">
278																<tbody>
279																	<tr>
280																		<td class="label">
281																			<xsl:text>Name:</xsl:text>
282																		</td>
283																		<td>
284																			<xsl:for-each select="mstns:Name">
285																				<xsl:apply-templates />
286																			</xsl:for-each>
287																		</td>
288																	</tr>
289																	<tr>
290																		<td class="label">
291																			<xsl:text>Namespace:</xsl:text>
292																		</td>
293																		<td>
294																			<xsl:for-each select="mstns:Namespace">
295																				<xsl:apply-templates />
296																			</xsl:for-each>
297																		</td>
298																	</tr>
299																	<tr>
300																		<td class="label">
301																			<xsl:text>Description:</xsl:text>
302																		</td>
303																		<td>
304																			<xsl:for-each select="mstns:Description">
305																				<xsl:apply-templates />
306																			</xsl:for-each>
307																		</td>
308																	</tr>
309																</tbody>
310															</table>
311														</xsl:for-each>
312													</xsl:for-each>
313												</div>
314											</xsl:if>
315										</xsl:for-each>
316									</div>
317								</xsl:for-each>
318							</div>
319						</xsl:for-each>
320					</xsl:for-each>
321				</xsl:for-each>
322			</body>
323		</html>
324	</xsl:template>
325</xsl:stylesheet>