-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpmd.xsl
More file actions
17 lines (17 loc) · 1.06 KB
/
phpmd.xsl
File metadata and controls
17 lines (17 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8" omit-xml-declaration="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="/pmd">
<xsl:if test="count(file//violation) > 0">
| Priority | File | Line | Rule | Message |
| -------- | ------ | ------------ | ----- | ------- |
<xsl:for-each select="file//violation"><xsl:sort select="@priority" order="descending"/>| <xsl:value-of select="concat('<span class="prio', @priority, '">', @priority, '</span>')"/> | src/<xsl:value-of select="substring-after(../@name, '/src/')"/> | <xsl:value-of select="@beginline"/> | [<xsl:value-of select="@rule"/>](<xsl:value-of select="@externalInfoUrl"/>) | <xsl:value-of select="normalize-space(translate(text(), "'", '`'))"/> |
</xsl:for-each>
Issues detected: <xsl:value-of select="count(file//violation)"/>
</xsl:if>
<xsl:if test="count(file//violation) = 0">
Good job. No issues found.
</xsl:if>
</xsl:template>
</xsl:stylesheet>