phpmd icon indicating copy to clipboard operation
phpmd copied to clipboard

On first run errors found are duplicated in report

Open u01jmg3 opened this issue 10 years ago • 1 comments

  • I am finding that the errors reported by PHPMD in its report are duplicated the first time I run PHPMD - without making any changes to the code or command I run on subsequent runs this duplication disappears. Is there any reason this might be happening?

phpmd-dupe-issue

u01jmg3 avatar Nov 10 '14 23:11 u01jmg3

  • Ruleset
<?xml version="1.0"?>
<ruleset name="Custom" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
    <description>Custom Coding Standards</description>

    <rule ref="rulesets/codesize.xml">
        <exclude name="TooManyMethods" />
    </rule>
    <rule ref="rulesets/codesize.xml/TooManyMethods" since="0.1" message="The class {1} has {2} methods. Consider refactoring {1} to keep number of methods under {3}." class="PHPMD\Rule\CodeSize\TooManyMethods" externalInfoUrl="http://phpmd.org/rules/codesize.html#toomanymethods">
        <priority>1</priority>
        <properties>
            <property name="maxmethods" value="65" />
        </properties>
    </rule>
    <rule ref="rulesets/design.xml">
        <exclude name="ExitExpression" />
    </rule>
    <rule ref="rulesets/unusedcode.xml">
        <exclude name="UnusedFormalParameter" />
    </rule>
    <rule ref="rulesets/naming.xml">
        <exclude name="ShortVariable" />
        <exclude name="LongVariable" />
    </rule>
    <rule ref="rulesets/naming.xml/ShortVariable" since="0.2" message="Avoid variables with short names like {0}. Configured minimum length is {1}." class="PHPMD\Rule\Naming\ShortVariable" externalInfoUrl="http://phpmd.org/rules/naming.html#shortvariable">
        <priority>3</priority>
        <properties>
            <property name="minimum" description="Minimum length for a variable, property or parameter name" value="3"/>
            <property name="exceptions" description="Comma-separated list of exceptions" value="id,pg,ch,fh,a,b,c,i,j,k,d,m,y,dd,mm,yy,hh,mi,ss,pp,in,ft,pt,to,or" />
        </properties>
    </rule>
    <rule ref="rulesets/naming.xml/LongVariable" since="0.2" message="Avoid excessively long variable names like {0}. Keep variable name length under {1}." class="PHPMD\Rule\Naming\LongVariable" externalInfoUrl="http://phpmd.org/rules/naming.html#longvariable">
        <description>Detects when a field, formal or local variable is declared with a long name.</description>
        <priority>3</priority>
        <properties>
            <property name="maximum" description="The variable length reporting threshold" value="38"/>
        </properties>
    </rule>
</ruleset>

u01jmg3 avatar Nov 10 '14 23:11 u01jmg3