-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcppcheck-gh.xslt
More file actions
109 lines (102 loc) · 5.31 KB
/
Copy pathcppcheck-gh.xslt
File metadata and controls
109 lines (102 loc) · 5.31 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?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>
<xsl:choose>
<xsl:when test="count(results/errors/error[@severity = 'error']) > 0 or count(results/errors/error[@severity = 'warning']) > 0 or count(results/errors/error[@severity = 'style']) > 0">
<xsl:if test="count(results/errors/error[@severity = 'error']) > 0">
<details>
<summary>
<h3>Errors (<xsl:value-of select="count(results/errors/error[@severity = 'error'])"/>)</h3>
</summary>
<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>
</details>
</xsl:if>
<xsl:if test="count(results/errors/error[@severity = 'warning']) > 0">
<details>
<summary>
<h3>Warnings (<xsl:value-of select="count(results/errors/error[@severity = 'warning'])"/>)</h3>
</summary>
<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>
</details>
</xsl:if>
<xsl:if test="count(results/errors/error[@severity = 'style']) > 0">
<details>
<summary>
<h3>Style Violations (<xsl:value-of select="count(results/errors/error[@severity = 'style'])"/>)</h3>
</summary>
<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>
</details>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<h3>No issues found</h3>
</xsl:otherwise>
</xsl:choose>
</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>