-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcppcheck-html.xslt
More file actions
86 lines (79 loc) · 3.13 KB
/
Copy pathcppcheck-html.xslt
File metadata and controls
86 lines (79 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html"/>
<xsl:param name="target_branch" select="'main'"/>
<xsl:key name="errorById" match="error" use="@id"/>
<xsl:template match="/">
<html>
<head>
<title>Results</title>
<style>
body {
font-family: Arial, sans-serif;
font-size: 14px;
color: #333;
}
</style>
</head>
<body>
<h1>CppCheck Report</h1>
<h2>Errors</h2>
<ul>
<xsl:for-each select="results/errors/error[@severity = 'error']">
<xsl:variable name="source">
<xsl:value-of select="concat(location/@file, '#L', location/@line)"/>
</xsl:variable>
<li>
<a href="https://github.com/DataDog/java-profiler/blob/target_branch/{$source}">
<xsl:value-of select="@msg"/>
</a>
</li>
</xsl:for-each>
</ul>
<hr/>
<h2>Warnings</h2>
<ul>
<xsl:for-each select="results/errors/error[@severity = 'warning']">
<xsl:variable name="source">
<xsl:value-of select="concat(location/@file, '#L', location/@line)"/>
</xsl:variable>
<li>
<a href="https://github.com/DataDog/java-profiler/blob/target_branch/{$source}">
<xsl:value-of select="@msg"/>
</a>
</li>
</xsl:for-each>
</ul>
<hr/>
<h2>Style Violations</h2>
<ul>
<xsl:for-each select="results/errors/error[@severity = 'style']">
<xsl:variable name="source">
<xsl:value-of select="concat(location/@file, '#L', location/@line)"/>
</xsl:variable>
<li>
<a href="https://github.com/DataDog/java-profiler/blob/target_branch/{$source}">
<xsl:value-of select="@msg"/>
</a>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="error">
<xsl:variable name="source">
<xsl:value-of select="concat(location/@file, '#L', location/@line)"/>
</xsl:variable>
<tr>
<td>
<div class="title"><xsl:value-of select="@msg"/></div>
<a href="https://github.com/DataDog/java-profiler/blob/target_branch/{$source}">
<xsl:value-of select="$source"/>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>