Warning, /graphics/digikam/project/reports/krazy/functions.xsl is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?> 0002 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 0003 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 0004 xmlns:ebn="http://ebn.kde.org/krazy" version="2.0"> 0005 0006 <xsl:import href="globalvars.xsl" /> 0007 0008 <!-- 0009 - Returns the repository rev for the project. 0010 - 0011 --> 0012 <xsl:function name="ebn:repoRev" as="xsd:string"> 0013 <xsl:value-of select="$global.doc/tool-result/global/repo-rev/@value" /> 0014 </xsl:function> 0015 0016 <!-- 0017 - Returns the checkSets for this run. 0018 - 0019 --> 0020 <xsl:function name="ebn:checkSets" as="xsd:string"> 0021 <xsl:value-of select="$global.doc/tool-result/global/check-sets/@value" /> 0022 </xsl:function> 0023 0024 <!-- 0025 - Returns the number of checkers run for given fileType. 0026 - 0027 - @p fileType The fileType for which to count the number of checkers run. 0028 - Give 'all' when you want the total number of checkers run. 0029 --> 0030 <xsl:function name="ebn:checkerCount" as="xsd:integer"> 0031 <xsl:param name="fileType" as="xsd:string" /> 0032 <xsl:sequence 0033 select="if ($fileType eq 'all') 0034 then count( $global.doc/tool-result/file-types/file-type/check ) 0035 else count( $global.doc/tool-result/file-types/file-type[@value=$fileType]/check )" /> 0036 </xsl:function> 0037 0038 <!-- 0039 - Returns the number of files which have issues. 0040 - 0041 - @p fileType The fileType for which to count the number of files having 0042 - issues. Give 'all' to get the total number of files which have 0043 - issues. 0044 --> 0045 <xsl:function name="ebn:numberOfFilesWithIssues" as="xsd:integer"> 0046 <xsl:param name="fileType" as="xsd:string" /> 0047 <xsl:sequence 0048 select="if ($fileType eq 'all') 0049 then count( $global.doc/tool-result/file-types/file-type/check/file ) 0050 else count( $global.doc/tool-result/file-types/file-type[@value=$fileType]/check/file )" /> 0051 </xsl:function> 0052 0053 <xsl:function name="ebn:issueCount" as="xsd:integer"> 0054 <xsl:param name="fileType" as="xsd:string" /> 0055 <xsl:param name="check" as="xsd:string" /> 0056 0057 <xsl:choose> 0058 <xsl:when test="$fileType ne 'all' and $check eq 'all'" > 0059 <xsl:sequence 0060 select="count( $global.doc/tool-result/file-types/file-type[@value=$fileType]/check/file/issues/line )" /> 0061 </xsl:when> 0062 <xsl:when test="$fileType eq 'all' and $check ne 'all'" > 0063 <xsl:sequence 0064 select="count( $global.doc/tool-result/file-types/file-type/check[@desc=$check]/file/issues/line )" /> 0065 </xsl:when> 0066 <xsl:when test="$fileType ne 'all' and $check ne 'all'" > 0067 <xsl:sequence 0068 select="count( $global.doc/tool-result/file-types/file-type[@value=$fileType] 0069 /check[@desc=$check]/file/issues/line )" /> 0070 </xsl:when> 0071 <xsl:otherwise> 0072 <xsl:sequence 0073 select="count( $global.doc/tool-result/file-types/file-type/check/file/issues/line )" /> 0074 </xsl:otherwise> 0075 </xsl:choose> 0076 </xsl:function> 0077 0078 <!-- 0079 - Returns the total number of files processed by krazy. 0080 --> 0081 <xsl:function name="ebn:processedFilesCount" as="xsd:integer"> 0082 <xsl:value-of select="$global.doc/tool-result/global/processed-files/@value" /> 0083 </xsl:function> 0084 0085 <!-- 0086 - Returns a formatted line number for LXR. 0087 --> 0088 <xsl:function name="ebn:formatLineNumber" as="xsd:string"> 0089 <xsl:param name="line" as="xsd:integer" /> 0090 <xsl:param name="maxlines" as="xsd:integer" /> 0091 <xsl:choose> 0092 <xsl:when test="$maxlines > 9999"> 0093 <xsl:value-of select="format-number($line, '00000')"/> 0094 </xsl:when> 0095 <xsl:otherwise> 0096 <xsl:value-of select="format-number($line, '0000')"/> 0097 </xsl:otherwise> 0098 </xsl:choose> 0099 </xsl:function> 0100 0101 <!-- 0102 - Returns the date on which the krazy report was generated. 0103 --> 0104 <xsl:function name="ebn:dateOfRun" as="xsd:string"> 0105 <xsl:value-of select="$global.doc/tool-result/global/date/@value" /> 0106 </xsl:function> 0107 </xsl:stylesheet> 0108 0109 <!-- kate:space-indent on; -->