Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/xsl/color.xsl

Issue 1232833004: Update findbugs from 3.0.0 to 3.0.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/findbugs.git@master
Patch Set: rebase again Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « plugin/noUpdateChecks.jar ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 FindBugs - Find bugs in Java programs
4 Copyright (C) 2004,2005 University of Maryland
5 Copyright (C) 2005, Chris Nappin
6 Copyright (C) 2015, Brahim Djoudi (modifications)
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 -->
22 <xsl:stylesheet version="1.0"
23 xmlns="http://www.w3.org/1999/xhtml"
24 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
25
26 <xsl:output
27 method="xml"
28 omit-xml-declaration="yes"
29 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
30 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
31 indent="yes"
32 encoding="UTF-8"/>
33
34 <xsl:variable name="bugTableHeader">
35 <tr class="tableheader">
36 <th align="left">Warning</th>
37 <th align="center">Priority</th>
38 <th align="left">Details</th>
39 </tr>
40 </xsl:variable>
41
42 <xsl:template match="/">
43 <html>
44 <head>
45 <title>FindBugs Report</title>
46 <style type="text/css">
47 .tablerow0 {
48 background: #EEEEEE;
49 }
50
51 .tablerow1 {
52 background: white;
53 }
54
55 .detailrow0 {
56 background: #EEEEEE;
57 }
58
59 .detailrow1 {
60 background: white;
61 }
62 .long_message {
63 color:#220001;
64 background: -moz-linear-gradient(left, rgba(255,255,255, 0) 0%, rgba(255,255,255,0.96) 24%, rgba(255,255,255,1) 25%, rgba(255,255,255,0) 100%); /* FF3.6+ */
65 background: -webkit-gradient(linear, left top, right top , color-stop(0%,rgba(255,255,255,0)), color-stop(24%,rgba(255,255,255,0.96)), co lor-stop(25%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chr ome,Safari4+ */
66 background: -webkit-linear-gradient(left, rgba(255,255,2 55,0) 0%,rgba(255,255,255,0.96) 24%,rgba(255,255,255,1) 25%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
67 background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.96) 24%,rgba(255,255,255,1) 25%,rgba(255,255,255,0) 100%) ; /* Opera 11.10+ */
68 background: -ms-linear-gradient(left, rgba(255,255,255,0 ) 0%,rgba(255,255,255,0.96) 24%,rgba(255,255,255,1) 25%,rgba(255,255,255,0) 100% ); /* IE10+ */
69 background: linear-gradient(to right, rgba(255,255,255,0 ) 0%,rgba(255,255,255,0.96) 24%,rgba(255,255,255,1) 25%,rgba(255,255,255,0) 100% ); /* W3C */
70 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 */
71 }
72
73 .tableheader {
74 font-size: larger;
75 background: -moz-linear-gradient(left, rgba(135,224,253 ,1) 0%, rgba(83,203,241,0.9) 40%, rgba(59,4,153,0.75) 100%); /* FF3.6+ */
76 background: -webkit-gradient(linear, left top, right top , color-stop(0%,rgba(135,224,253,1)), color-stop(40%,rgba(83,203,241,0.9)), colo r-stop(100%,rgba(59,4,153,0.75))); /* Chrome,Safari4+ */
77 background: -webkit-linear-gradient(left, rgba(135,224, 253,1) 0%,rgba(83,203,241,0.9) 40%,rgba(59,4,153,0.75) 100%); /* Chrome10+,Safar i5.1+ */
78 background: -o-linear-gradient(left, rgba(135,224,253,1 ) 0%,rgba(83,203,241,0.9) 40%,rgba(59,4,153,0.75) 100%); /* Opera 11.10+ */
79 background: -ms-linear-gradient(left, rgba(135,224,253, 1) 0%,rgba(83,203,241,0.9) 40%,rgba(59,4,153,0.75) 100%); /* IE10+ */
80 background: linear-gradient(to right, rgba(135,224,253, 1) 0%,rgba(83,203,241,0.9) 40%,rgba(59,4,153,0.75) 100%); /* W3C */
81 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#87e0fd', endColorstr='#bf3b0499',GradientType=1 ); /* IE6-9 */
82
83 }
84 .high {
85 background: -moz-linear-gradient(top, rgba(239,187,110,0 .93) 0%, rgba(255,26,0,0.97) 52%, rgba(239,187,110,1) 100%); /* FF3.6+ */
86 background: -webkit-gradient(linear, left top, left bott om, color-stop(0%,rgba(239,187,110,0.93)), color-stop(52%,rgba(255,26,0,0.97)), color-stop(100%,rgba(239,187,110,1))); /* Chrome,Safari4+ */
87 background: -webkit-linear-gradient(top, rgba(239,187,11 0,0.93) 0%,rgba(255,26,0,0.97) 52%,rgba(239,187,110,1) 100%); /* Chrome10+,Safar i5.1+ */
88 background: -o-linear-gradient(top, rgba(239,187,110,0.9 3) 0%,rgba(255,26,0,0.97) 52%,rgba(239,187,110,1) 100%); /* Opera 11.10+ */
89 background: -ms-linear-gradient(top, rgba(239,187,110,0. 93) 0%,rgba(255,26,0,0.97) 52%,rgba(239,187,110,1) 100%); /* IE10+ */
90 background: linear-gradient(to bottom, rgba(239,187,110, 0.93) 0%,rgba(255,26,0,0.97) 52%,rgba(239,187,110,1) 100%); /* W3C */
91 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#edefbb6e', endColorstr='#efbb6e',GradientType=0 ); /* IE6-9 */
92 }
93 .medium {
94 background: -moz-linear-gradient(top, rgba(244,232,117,1 ) 0%, rgba(239,187,110,0.96) 52%, rgba(244,232,117,0.93) 100%); /* FF3.6+ */
95 background: -webkit-gradient(linear, left top, left bott om, color-stop(0%,rgba(244,232,117,1)), color-stop(52%,rgba(239,187,110,0.96)), color-stop(100%,rgba(244,232,117,0.93))); /* Chrome,Safari4+ */
96 background: -webkit-linear-gradient(top, rgba(244,232,11 7,1) 0%,rgba(239,187,110,0.96) 52%,rgba(244,232,117,0.93) 100%); /* Chrome10+,Sa fari5.1+ */
97 background: -o-linear-gradient(top, rgba(244,232,117,1) 0%,rgba(239,187,110,0.96) 52%,rgba(244,232,117,0.93) 100%); /* Opera 11.10+ */
98 background: -ms-linear-gradient(top, rgba(244,232,117,1) 0%,rgba(239,187,110,0.96) 52%,rgba(244,232,117,0.93) 100%); /* IE10+ */
99 background: linear-gradient(to bottom, rgba(244,232,117, 1) 0%,rgba(239,187,110,0.96) 52%,rgba(244,232,117,0.93) 100%); /* W3C */
100 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#f4e875', endColorstr='#edf4e875',GradientType=0 ); /* IE6-9 */
101 }
102 .low {
103 background: -moz-linear-gradient(top, rgba(244,232,117,0 .93) 0%, rgba(140,186,124,0.97) 53%, rgba(244,232,117,1) 100%); /* FF3.6+ */
104 background: -webkit-gradient(linear, left top, left bott om, color-stop(0%,rgba(244,232,117,0.93)), color-stop(53%,rgba(140,186,124,0.97) ), color-stop(100%,rgba(244,232,117,1))); /* Chrome,Safari4+ */
105 background: -webkit-linear-gradient(top, rgba(244,232,11 7,0.93) 0%,rgba(140,186,124,0.97) 53%,rgba(244,232,117,1) 100%); /* Chrome10+,Sa fari5.1+ */
106 background: -o-linear-gradient(top, rgba(244,232,117,0.9 3) 0%,rgba(140,186,124,0.97) 53%,rgba(244,232,117,1) 100%); /* Opera 11.10+ */
107 background: -ms-linear-gradient(top, rgba(244,232,117,0. 93) 0%,rgba(140,186,124,0.97) 53%,rgba(244,232,117,1) 100%); /* IE10+ */
108 background: linear-gradient(to bottom, rgba(244,232,117, 0.93) 0%,rgba(140,186,124,0.97) 53%,rgba(244,232,117,1) 100%); /* W3C */
109 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#edf4e875', endColorstr='#f4e875',GradientType=0 ); /* IE6-9 */
110 }
111 pre {
112 font-family: "Bitstream Vera Sans Mono", Consolas, Incon solata, "Lucida Console", "Courier New", Monospace !important;
113 box-shadow: 0 0;
114 color: black;
115 border-width: 1px 1px 1px 6px;
116 border-style: solid;
117 padding: 2ex;
118 margin: 2ex 2ex 2ex 2ex;
119 overflow: auto;
120 -moz-border-radius: 0px;
121 -webkit-border-radius: 0px;
122 -khtml-border-radius: 0px;
123 border-radius: 0px;
124 border-color: #996666;
125
126 background: rgb(232,239,244); /* Old browsers */
127 background: -moz-linear-gradient(left, rgba(232,239,244, 1) 1%, rgba(244,249,249,1) 23%, rgba(249,250,246,1) 87%, rgba(241,242,236,1) 98% ); /* FF3.6+ */
128 background: -webkit-gradient(linear, left top, right top , color-stop(1%,rgba(232,239,244,1)), color-stop(23%,rgba(244,249,249,1)), color -stop(87%,rgba(249,250,246,1)), color-stop(98%,rgba(241,242,236,1))); /* Chrome, Safari4+ */
129 background: -webkit-linear-gradient(left, rgba(232,239,2 44,1) 1%,rgba(244,249,249,1) 23%,rgba(249,250,246,1) 87%,rgba(241,242,236,1) 98% ); /* Chrome10+,Safari5.1+ */
130 background: -o-linear-gradient(left, rgba(232,239,244,1) 1%,rgba(244,249,249,1) 23%,rgba(249,250,246,1) 87%,rgba(241,242,236,1) 98%); /* Opera 11.10+ */
131 background: -ms-linear-gradient(left, rgba(232,239,244,1 ) 1%,rgba(244,249,249,1) 23%,rgba(249,250,246,1) 87%,rgba(241,242,236,1) 98%); / * IE10+ */
132 background: linear-gradient(to right, rgba(232,239,244,1 ) 1%,rgba(244,249,249,1) 23%,rgba(249,250,246,1) 87%,rgba(241,242,236,1) 98%); / * W3C */
133 filter: progid:DXImageTransform.Microsoft.gradient( star tColorstr='#e8eff4', endColorstr='#f1f2ec',GradientType=1 ); /* IE6-9 */
134 }
135 </style>
136 </head>
137
138 <xsl:variable name="unique-catkey" select="/BugCollection/BugCategory/@c ategory"/>
139 <!--xsl:variable name="unique-catkey" select="/BugCollection/BugInstance [generate-id() = generate-id(key('bug-category-key',@category))]/@category"/-->
140
141 <body>
142
143 <h1>FindBugs Report</h1>
144 <p>Produced using <a href="http://findbugs.sourceforge.net">Find Bugs </a> <xsl:value-of select="/BugCollection/@version"/>.</p>
145 <p>Project:
146 <xsl:choose>
147 <xsl:when test='string-length(/BugCollection/Pro ject/@projectName)>0'><xsl:value-of select="/BugCollection/Project/@projectName" /></xsl:when>
148 <xsl:otherwise><xsl:value-of select="/BugCollect ion/Project/@filename" /></xsl:otherwise>
149 </xsl:choose>
150 </p>
151
152 <table style="width:90%;">
153 <tr>
154 <td>
155 <h2>Metrics</h2>
156 <xsl:apply-templates select="/BugCollect ion/FindBugsSummary"/>
157 </td>
158 <td>
159 <h2>Summary</h2>
160 <table cellpadding="5" cellspacing="2" s tyle="width:90%;border-collapse: collapse;border-style:solid;border-width:thin;" >
161 <tr class="tableheader">
162 <th align="left">Warning Type</th>
163 <th align="right">Number </th>
164 </tr>
165
166 <xsl:for-each select="$unique-catkey">
167 <xsl:sort select="." order="asce nding"/>
168 <xsl:variable name="catkey" sele ct="."/>
169 <xsl:variable name="catdesc" sel ect="/BugCollection/BugCategory[@category=$catkey]/Description"/>
170 <xsl:variable name="styleclass">
171 <xsl:choose><xsl:when te st="position() mod 2 = 1">tablerow0</xsl:when>
172 <xsl:otherwise>t ablerow1</xsl:otherwise>
173 </xsl:choose>
174 </xsl:variable>
175
176 <tr class="{$styleclass}">
177 <td><a href="#Warnings_{ $catkey}"><xsl:value-of select="$catdesc"/> Warnings</a></td>
178 <td align="right"><xsl:v alue-of select="count(/BugCollection/BugInstance[@category=$catkey])"/></td>
179 </tr>
180 </xsl:for-each>
181
182 <xsl:variable name="styleclass">
183 <xsl:choose><xsl:when test="coun t($unique-catkey) mod 2 = 0">tablerow0</xsl:when>
184 <xsl:otherwise>tablerow1 </xsl:otherwise>
185 </xsl:choose>
186 </xsl:variable>
187 <tr class="{$styleclass}">
188 <td><b>Total</b></td>
189 <td align="right"><b><xsl:va lue-of select="count(/BugCollection/BugInstance)"/></b></td>
190 </tr>
191 </table>
192 </td>
193 </tr>
194 </table>
195
196 <p><br/><br/></p>
197
198 <h1>Warnings</h1>
199
200 <p>Click on each warning link to see a full description of the issue, an d
201 details of how to resolve it.</p>
202
203 <xsl:for-each select="$unique-catkey">
204 <xsl:sort select="." order="ascending"/>
205 <xsl:variable name="catkey" select="."/>
206 <xsl:variable name="catdesc" select="/BugCollection/BugCategory[ @category=$catkey]/Description"/>
207
208 <xsl:call-template name="generateWarningTable">
209 <xsl:with-param name="warningSet" select="/BugCollection /BugInstance[@category=$catkey]"/>
210 <xsl:with-param name="sectionTitle"><xsl:value-of select ="$catdesc"/> Warnings</xsl:with-param>
211 <xsl:with-param name="sectionId">Warnings_<xsl:value-of select="$catkey"/></xsl:with-param>
212 </xsl:call-template>
213 </xsl:for-each>
214
215 <p><br/><br/></p>
216 <h1><a name="Details">Warning Types</a></h1>
217
218 <xsl:apply-templates select="/BugCollection/BugPattern">
219 <xsl:sort select="@abbrev"/>
220 <xsl:sort select="ShortDescription"/>
221 </xsl:apply-templates>
222
223 </body>
224 </html>
225 </xsl:template>
226
227 <xsl:template match="BugInstance">
228 <xsl:variable name="warningId"><xsl:value-of select="generate-id()"/></x sl:variable>
229
230 <tr>
231 <!-- class="tablerow{position() mod 2}" -->
232 <xsl:choose>
233 <xsl:when test="@priority = 1"><xsl:attribute name="clas s">high</xsl:attribute></xsl:when>
234 <xsl:when test="@priority = 2"><xsl:attribute name="clas s">medium</xsl:attribute></xsl:when>
235 <xsl:when test="@priority = 3"><xsl:attribute name="clas s">low</xsl:attribute></xsl:when>
236 <xsl:otherwise><xsl:attribute name="bgcolor">#fdfdfd</xs l:attribute></xsl:otherwise>
237 </xsl:choose>
238 <td width="20%" valign="top">
239 <a href="#{@type}"><xsl:value-of select="ShortMessage"/> </a>
240 </td>
241 <td width="10%" valign="top" align="center">
242 <xsl:choose>
243 <xsl:when test="@priority = 1"><strong>High</str ong></xsl:when>
244 <xsl:when test="@priority = 2">Medium</xsl:when>
245 <xsl:when test="@priority = 3">Low</xsl:when>
246 <xsl:otherwise>Unknown</xsl:otherwise>
247 </xsl:choose>
248 </td>
249 <td width="70%">
250 <dl>
251 <dt class='long_message'><xsl:value-of select="L ongMessage"/></dt>
252 <dd>
253 <!-- add source filename and line numbe r(s), if any -->
254 <xsl:if test="SourceLine">
255 In file <tt><strong><xsl:value-o f select="SourceLine/@sourcefile"/></strong></tt>,
256 <xsl:choose>
257 <xsl:when test="SourceLi ne/@start = SourceLine/@end">
258 line <xsl:value-of selec t="SourceLine/@start"/>
259 </xsl:when>
260 <xsl:otherwise>
261 lines <xsl:value-of sele ct="SourceLine/@start"/>
262 to <xsl:value-of sel ect="SourceLine/@end"/>
263 </xsl:otherwise>
264 </xsl:choose>
265 </xsl:if>
266
267 <xsl:for-each select="./*/Message">
268 <br/><xsl:value-of select="text( )"/>
269 </xsl:for-each>
270 </dd>
271 </dl>
272 </td>
273 </tr>
274 </xsl:template>
275
276 <xsl:template match="BugPattern">
277 <h2><a name="{@type}"><xsl:value-of select="ShortDescription"/></a></h2>
278 <xsl:value-of select="Details" disable-output-escaping="yes"/>
279 <p><br/><br/></p>
280 </xsl:template>
281
282 <xsl:template name="generateWarningTable">
283 <xsl:param name="warningSet"/>
284 <xsl:param name="sectionTitle"/>
285 <xsl:param name="sectionId"/>
286
287 <h2><a name="{$sectionId}"><xsl:value-of select="$sectionTitle"/></a></h 2>
288 <table class="warningtable" cellspacing="2" cellpadding="5" style="width :100%;border-collapse: collapse;border-style:solid;border-width:thin;">
289 <xsl:copy-of select="$bugTableHeader"/>
290 <xsl:choose>
291 <xsl:when test="count($warningSet) &gt; 0">
292 <xsl:apply-templates select="$warningSet">
293 <xsl:sort select="@priority"/>
294 <xsl:sort select="@abbrev"/>
295 <xsl:sort select="Class/@classname"/>
296 </xsl:apply-templates>
297 </xsl:when>
298 <xsl:otherwise>
299 <tr><td colspan="2"><p><i>None</i></p></td></tr>
300 </xsl:otherwise>
301 </xsl:choose>
302 </table>
303 <p><br/><br/></p>
304 </xsl:template>
305
306 <xsl:template match="FindBugsSummary">
307 <xsl:variable name="kloc" select="@total_size div 1000.0"/>
308 <xsl:variable name="format" select="'#######0.00'"/>
309
310 <p><xsl:value-of select="@total_size"/> lines of code analysed,
311 in <xsl:value-of select="@total_classes"/> classes,
312 in <xsl:value-of select="@num_packages"/> packages.</p>
313 <table cellpadding="5" cellspacing="2" style="width:90%;border-collapse: collapse;border-style:solid;border-width:thin;">
314 <tr class="tableheader">
315 <th align="left">Metric</th>
316 <th align="right">Total</th>
317 <th align="right">Density*</th>
318 </tr>
319 <tr class="high" >
320 <td>High Priority Warnings</td>
321 <td align="right"><xsl:value-of select="@priority_1"/></ td>
322 <td align="right"><xsl:value-of select="format-number(@p riority_1 div $kloc, $format)"/></td>
323 </tr>
324 <tr class="medium">
325 <td>Medium Priority Warnings</td>
326 <td align="right"><xsl:value-of select="@priority_2"/></ td>
327 <td align="right"><xsl:value-of select="format-number(@p riority_2 div $kloc, $format)"/></td>
328 </tr>
329
330 <xsl:choose>
331 <xsl:when test="@priority_3">
332 <tr class="low">
333 <td>Low Priority Warnings</td>
334 <td align="right"><xsl:value-of select="@priorit y_3"/></td>
335 <td align="right"><xsl:value-of select="format-n umber(@priority_3 div $kloc, $format)"/></td>
336 </tr>
337 </xsl:when>
338 </xsl:choose>
339
340 <tr bgcolor="#f0f0f0">
341 <td><b>Total Warnings</b></td>
342 <td align="right"><b><xsl:value-of select="@total_bugs"/ ></b></td>
343 <td align="right"><b><xsl:value-of select="format-number (@total_bugs div $kloc, $format)"/></b></td>
344 </tr>
345 </table>
346 <p><i>(* Defects per thousand lines of non-commenting source statements) </i></p>
347 <p><br/><br/></p>
348
349 </xsl:template>
350
351 </xsl:stylesheet>
OLDNEW
« no previous file with comments | « plugin/noUpdateChecks.jar ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698