[jsword-svn] jsword-support/tools/pmd-2.3 s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Mon Mar 14 19:19:03 MST 2005


Update of /cvs/jsword/jsword-support/tools/pmd-2.3
In directory www.crosswire.org:/tmp/cvs-serv16002/tools/pmd-2.3

Added Files:
	pmd-2.3.jar LICENSE.txt saxpath-1.0-fcs.jar 
	xmlParserAPIs-2.6.2.jar xercesImpl-2.6.2.jar build.xml 
	jaxen-core-1.0-fcs.jar pmd-report.xslt ruleset.xml 
Log Message:
Updated the tools to most recent versions.


--- NEW FILE: build.xml ---
<project name="pmd" default="pmd">

  <!-- this should be overridden by the parent file -->
  <property name="support.tools" value=".."/>

  <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
	<classpath>
	  <fileset dir="${support.tools}" includes="pmd*/**/*.jar"/>
	</classpath>
  </taskdef>

  <target name="pmd">
    <mkdir dir="${target.web}/pmd"/>
    <pmd rulesetfiles="${basedir}/${support.tools}/pmd-2.3/ruleset.xml" shortFilenames="true">
      <formatter type="html" toFile="${target.web}/pmd/index.html"/>
      <fileset dir="..">
        <patternset refid="pattern.alljava"/>
      </fileset>
    </pmd>
  </target>

  <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
	<classpath>
	  <fileset dir="${support.tools}" includes="pmd*/**/*.jar"/>
	</classpath>
  </taskdef>

  <target name="cpd">
    <mkdir dir="${target.web}/cpd"/>
    <cpd minimumTokenCount="100" outputFile="${target.web}/cpd/report.txt">
      <fileset dir="..">
        <patternset refid="pattern.alljava"/>
      </fileset>
    </cpd>
  </target>

</project>

--- NEW FILE: jaxen-core-1.0-fcs.jar ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: xmlParserAPIs-2.6.2.jar ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: pmd-report.xslt ---
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:variable name="cvsweb">http://doc.ece.uci.edu/cvs/viewcvs.cgi/Zen/packages/src/</xsl:variable>

<xsl:template match="pmd">
<html>
<head>
    <title>PMD Report</title>
    <style type="text/css">
        body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
        table.details tr th { font-weight: bold; text-align:left; background:#a6caf0; }
        table.details tr td { background:#eeeee0; }
    </style>
</head>
<body>
    <H1>PMD Report</H1>
    <hr/>
    <xsl:for-each select="file">
        <xsl:sort data-type="number" order="descending" select="count(violation)"/>
        <xsl:variable name="filename" select="@name"/>
        <H3><xsl:value-of disable-output-escaping="yes" select="substring-before(translate(@name,'/','.'),'.java')"/></H3>
        <table border="0" width="100%" class="details">
            <tr>
                <th>Line</th>
                <th align="left">Description</th>
            </tr>
	    
	    <xsl:for-each select="violation">
		    <tr>
			<td style="padding: 3px" align="right"><a><xsl:attribute name="href"><xsl:value-of select="$cvsweb"/><xsl:value-of select="$filename"/>?annotate=HEAD#<xsl:value-of disable-output-escaping="yes" select="@line"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@line"/></a></td>
			<td style="padding: 3px" align="left" width="100%"><xsl:value-of disable-output-escaping="yes" select="."/></td>
		    </tr>
	    </xsl:for-each>
    
        </table>
        <br/>
    </xsl:for-each>
    <p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:value-of select="//pmd/@timestamp"/>.</p>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

--- NEW FILE: xercesImpl-2.6.2.jar ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ruleset.xml ---
<?xml version="1.0"?>

<ruleset name="Basic Rules">
  <description>A fairly global ruleset containing almost everything</description>

  <!-- <rule ref="rulesets/basic.xml/EmptyCatchBlock"/> done better by checkstyle -->
  <!-- <rule ref="rulesets/basic.xml/EmptyIfStmt"/> done better by checkstyle -->
  <rule ref="rulesets/basic.xml/EmptyWhileStmt"/>
  <rule ref="rulesets/basic.xml/EmptyTryBlock"/>
  <rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>
  <rule ref="rulesets/basic.xml/EmptySwitchStatements"/>
  <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
  <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
  <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporaryRule"/>
  <rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcodeRule"/>
  <rule ref="rulesets/basic.xml/DoubleCheckedLockingRule"/>
  <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
  <rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>
  <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
  <rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>
  <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
  <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>

  <!-- <rule ref="rulesets/naming.xml/ShortVariable"/> -->
  <!-- <rule ref="rulesets/naming.xml/LongVariable"/> -->
  <rule ref="rulesets/naming.xml/ShortMethodNameRule"/>
  <!-- <rule ref="rulesets/naming.xml/VariableNamingConventionsRule"/> -->
  <rule ref="rulesets/naming.xml/MethodNamingConventions"/>
  <rule ref="rulesets/naming.xml/ClassNamingConventionsRule"/>
  <!-- <rule ref="rulesets/naming.xml/AbstractNamingRule"/> errors on FooAbstractBlah wrongly -->
  <rule ref="rulesets/naming.xml/AvoidDollarSigns"/>
  <rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>
  <rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>

  <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
  <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
  <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
  <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>

  <!-- <rule ref="rulesets/design.xml/UseSingletonRule"/> -->
  <rule ref="rulesets/design.xml/SimplifyBooleanReturnsRule"/>
  <rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
  <rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>
  <!-- <rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/> -->
  <!-- <rule ref="rulesets/design.xml/AvoidReassigningParametersRule"/> 18 infringements, but silly fixing -->
  <!-- <rule ref="rulesets/design.xml/SwitchDensity"/> -->
  <!-- <rule ref="rulesets/design.xml/ConstructorCallsOverridableMethodRule"/> 64 infringements, might be worth working through -->
  <rule ref="rulesets/design.xml/AccessorClassGenerationRule"/>
  <rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>
  <rule ref="rulesets/design.xml/BooleanInstantiation"/>
  <rule ref="rulesets/design.xml/CloseConnectionRule"/>
  <rule ref="rulesets/design.xml/NonStaticInitializer"/>
  <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>
  <rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>
  <!-- try me <rule ref="rulesets/design.xml/OptimizableToArrayCallRule"/> -->
  <rule ref="rulesets/design.xml/BadComparisonRule"/>
  <rule ref="rulesets/design.xml/EqualsNull"/>
  <!-- <rule ref="rulesets/design.xml/ConfusingTernary"/> allow (test ? 1 : 2) -->

  <rule ref="rulesets/imports.xml/DuplicateImports"/>
  <rule ref="rulesets/imports.xml/DontImportJavaLang"/>
  <rule ref="rulesets/imports.xml/UnusedImports"/>
  <rule ref="rulesets/imports.xml/ImportFromSamePackage"/>

  <!-- however *test is exempt from coding conventions so these are not run -->
  <rule ref="rulesets/junit.xml/JUnitStaticSuite"/>
  <rule ref="rulesets/junit.xml/JUnitSpelling"/>
  <!-- <rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessageRule"/> -->

  <!-- <rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/ 25 infringements, but silly fixing -->
  <!-- <rule ref="rulesets/strings.xml/StringInstantiation"/> PasswordField new String(getPassword()) -->
  <rule ref="rulesets/strings.xml/StringToString"/>

  <!-- <rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/> 402 infringements -->
  <rule ref="rulesets/braces.xml/WhileLoopsMustUseBracesRule"/>
  <rule ref="rulesets/braces.xml/IfElseStmtsMustUseBracesRule"/>
  <rule ref="rulesets/braces.xml/ForLoopsMustUseBracesRule"/>

  <!-- <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/> -->
  <!-- <rule ref="rulesets/codesize.xml/ExcessiveParameterList"/> -->
  <!-- <rule ref="rulesets/codesize.xml/ExcessiveClassLength"/> -->
  <!-- <rule ref="rulesets/codesize.xml/CyclomaticComplexityRule"/> 32 infringements, maybe check comments? -->
  <rule ref="rulesets/codesize.xml/ExcessivePublicCountRule"/>

  <!-- <rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/> -->

  <rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>
  <rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>
  <rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>
  <rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>
  <rule ref="rulesets/finalizers.xml/ExplicitCallToFinalize"/>
  <rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>

  <rule ref="rulesets/clone.xml/ProperCloneImplementationRule"/>
  <!-- try me <rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/> -->
  <!-- try me <rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/> -->

  <!-- <rule ref="rulesets/coupling.xml/CouplingBetweenObjectsRule"/> 9 infringements, but silly fixing-->
  <!-- <rule ref="rulesets/coupling.xml/ExcessiveImportsRule"/> -->
  <rule ref="rulesets/coupling.xml/LooseCouplingRule"/>

  <rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>
  <!-- <rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/> -->
  <rule ref="rulesets/strictexception.xml/ExceptionTypeChecking"/>
  <!-- try me <rule ref="rulesets/strictexception.xml/ExceptionAsFlowControlRule"/> -->
  <!-- try me <rule ref="rulesets/strictexception.xml/AvoidCatchingNPERule"/> -->
  <!-- try me <rule ref="rulesets/strictexception.xml/AvoidThrowingCertainExceptionTypesRule"/> -->

  <rule ref="rulesets/controversial.xml/UnnecessaryConstructorRule"/>
  <!-- <rule ref="rulesets/controversial.xml/NullAssignment"/> -->
  <!-- <rule ref="rulesets/controversial.xml/OnlyOneReturn"/> 406 infringements -->
  <!-- <rule ref="rulesets/controversial.xml/UnusedModifier"/> -->
  <rule ref="rulesets/controversial.xml/AssignmentInOperandRule"/>
  <!-- <rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/> -->
  <rule ref="rulesets/controversial.xml/DontImportSunRule"/>
  <rule ref="rulesets/controversial.xml/SuspiciousOctalEscapeRule"/>

</ruleset>

--- NEW FILE: pmd-2.3.jar ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: saxpath-1.0-fcs.jar ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: LICENSE.txt ---
Copyright (c) 2003, InfoEther, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
    * The end-user documentation included with the redistribution, if
any, must include the following acknowledgement:
      "This product includes software developed in part by support from
the Defense Advanced Research Project Agency (DARPA)"
    * Neither the name of InfoEther, LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


More information about the jsword-svn mailing list