Applied MPCHECKSTYLE-15

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion 2004-01-29 05:34:55 +00:00
parent 6982e0f933
commit aa3a6e65ea
2 changed files with 103 additions and 80 deletions

View File

@ -7,7 +7,7 @@
xmlns:util="jelly:util"
xmlns:x="jelly:xml"
xmlns:doc="doc"
xmlns="dummy" trim="false">
xmlns="dummy" trim="true">
<!-- This needs to be instantiated here to be available in the template matches -->
<j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/>
@ -26,8 +26,7 @@
<section name="Checkstyle Results">
<p>
The following document contains the results of
<a
href="http://checkstyle.sourceforge.net/">Checkstyle</a>.
<a href="http://checkstyle.sourceforge.net/">Checkstyle</a>.
</p>
</section>
@ -36,56 +35,64 @@
<j:set var="infoCount"><x:expr select="count(file/error[@severity='info'])"/></j:set>
<j:set var="warningCount"><x:expr select="count(file/error[@severity='warning'])"/></j:set>
<j:set var="errorCount"><x:expr select="count(file/error[@severity='error'])"/></j:set>
<table>
<tr>
<th>Files</th>
<th width="75">Infos</th>
<th width="75">Warnings</th>
<th width="75">Errors</th>
</tr>
<tr>
<td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${infoCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${warningCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td>
</tr>
<table summary="Report summary">
<thead>
<tr>
<th>Files</th>
<th style="width:75px">Infos</th>
<th style="width:75px">Warnings</th>
<th style="width:75px">Errors</th>
</tr>
</thead>
<tbody>
<tr>
<td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${infoCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${warningCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td>
</tr>
</tbody>
</table>
</section>
<section name="Files">
<table>
<tr>
<th>Files</th>
<th width="30">I</th>
<th width="30">W</th>
<th width="30">E</th>
</tr>
<j:set var="fullSrcDir" value="${pom.build.sourceDirectory}"/>
<j:set var="srcDir" value="${fileutil.file(fullSrcDir).getCanonicalPath()}"/>
<j:set var="srcDirLength" value="${srcDir.length() + 1}"/>
<x:set var="files" select="file" sort="@name"/>
<!-- x:forEach is busted -->
<j:forEach var="file" items="${files}">
<!-- Type coercion doesn't work worth a fuck in jexl. -->
<j:set var="name" value="${file.attribute('name').getValue()}"/>
<j:set var="name" value="${name.substring(mavenTool.toInteger(srcDirLength.toString()))}"/>
<util:replace var="name" value="${name}" oldChar="\\" newChar="/"/>
<!--- +1 is for the trailing slash above -->
<j:set var="infoCount"><x:expr select="count($file/error[@severity='info'])"/></j:set>
<j:set var="warningCount"><x:expr select="count($file/error[@severity='warning'])"/></j:set>
<j:set var="errorCount"><x:expr select="count($file/error[@severity='error'])"/></j:set>
<j:if test="${errorCount + warningCount + infoCount != 0}">
<tr>
<td>
<a href="#${name}">${name}</a>
</td>
<td><doc:formatAsNumber string="${infoCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${warningCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td>
</tr>
</j:if>
</j:forEach>
<table summary="Files">
<thead>
<tr>
<th>Files</th>
<th style="width:30px">I</th>
<th style="width:30px">W</th>
<th style="width:30px">E</th>
</tr>
</thead>
<tbody>
<j:set var="fullSrcDir" value="${pom.build.sourceDirectory}"/>
<j:set var="srcDir" value="${fileutil.file(fullSrcDir).getCanonicalPath()}"/>
<j:set var="srcDirLength" value="${srcDir.length() + 1}"/>
<x:set var="files" select="file" sort="@name"/>
<!-- x:forEach is busted -->
<j:forEach var="file" items="${files}">
<!-- Type coercion doesn't work worth a fuck in jexl. -->
<j:set var="name" value="${file.attribute('name').getValue()}"/>
<j:set var="name" value="${name.substring(mavenTool.toInteger(srcDirLength.toString()))}"/>
<util:replace var="name" value="${name}" oldChar="\\" newChar="/"/>
<!--- +1 is for the trailing slash above -->
<j:set var="infoCount"><x:expr select="count($file/error[@severity='info'])"/></j:set>
<j:set var="warningCount"><x:expr select="count($file/error[@severity='warning'])"/></j:set>
<j:set var="errorCount"><x:expr select="count($file/error[@severity='error'])"/></j:set>
<j:if test="${errorCount + warningCount + infoCount != 0}">
<tr>
<td>
<a href="#${name}">${name}</a>
</td>
<td><doc:formatAsNumber string="${infoCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${warningCount}" pattern="0"/></td>
<td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td>
</tr>
</j:if>
</j:forEach>
</tbody>
</table>
<j:forEach var="file" items="${files}">
@ -96,39 +103,52 @@
<util:replace var="name" value="${name}" oldChar="\\" newChar="/"/>
<subsection name="${name}">
<table>
<tr>
<th>Error</th>
<th width="75">Severity</th>
<th width="75">Line</th>
</tr>
<table summary="Error details for ${name}">
<thead>
<tr>
<th colspan="2">Error</th>
<th style="width:20px">Line</th>
</tr>
</thead>
<x:set var="errors" select="$file/error"/>
<j:forEach var="error" items="${errors}">
<tr>
<td>
<j:set var="errorMessage" value="${error.attribute('message').getValue()}"/>
${htmlescape.getText(errorMessage)}
</td>
<td>
<j:set var="severity" value="${error.attribute('severity').getValue()}"/>
${htmlescape.getText(severity)}
</td>
<td>
<j:set var="line" value="${error.attribute('line').getValue()}"/>
<j:set var="lastIndex" value="${name.lastIndexOf('.java')}"/>
<j:choose>
<j:when test="${lastIndex > 0}">
<j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/>
<j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/>
<util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/>
<a href="xref/${nameWithoutJavaExtension}.html#${line}">${line}</a>
</j:when>
<j:otherwise>
${line}
</j:otherwise>
</j:choose>
</td>
</tr>
<tbody>
<tr>
<td style="width:20px">
<j:set var="severity" value="${error.attribute('severity').getValue()}"/>
<j:choose>
<j:when test="${severity == 'error'}">
<img src="images/icon_error_sml.gif" width="15" height="15" alt="Error" />
</j:when>
<j:when test="${severity == 'warning'}">
<img src="images/icon_warning_sml.gif" width="15" height="15" alt="Warning" />
</j:when>
<j:when test="${severity == 'info'}">
<img src="images/icon_info_sml.gif" width="15" height="15" alt="Info" />
</j:when>
</j:choose>
</td>
<td>
<j:set var="errorMessage" value="${error.attribute('message').getValue()}"/>
${htmlescape.getText(errorMessage)}
</td>
<td>
<j:set var="line" value="${error.attribute('line').getValue()}"/>
<j:set var="lastIndex" value="${name.lastIndexOf('.java')}"/>
<j:choose>
<j:when test="${lastIndex > 0}">
<j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/>
<j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/>
<util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/>
<a href="xref/${nameWithoutJavaExtension}.html#${line}">${line}</a>
</j:when>
<j:otherwise>
${line}
</j:otherwise>
</j:choose>
</td>
</tr>
</tbody>
</j:forEach>
</table>
</subsection>

View File

@ -9,6 +9,9 @@
<body>
<release version="2.3" date="in CVS">
<action dev="dion" type="update">
Applied MPCHECKSTYLE-15
</action>
<action dev="vmassol" type="update">
Upgraded to Checkstyle 3.3.
</action>