Skip to content

Instantly share code, notes, and snippets.

@dimamix
Created January 20, 2016 18:59
Show Gist options
  • Save dimamix/2a576656c496b2f589be to your computer and use it in GitHub Desktop.
Save dimamix/2a576656c496b2f589be to your computer and use it in GitHub Desktop.
phpmd.xml example
<?xml version="1.0"?>
<ruleset>
<description>Custom ruleset for Behance code standards</description>
<!-- Rues are imported individually to allow for easy configuration -->
<!-- Property names and values can be found here: http://phpmd.org/rules/index.html -->
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
<property name="ignore-whitespace" value="true" />
<property name="minimum" value="150" />
</properties>
</rule>
<rule ref="rulesets/controversial.xml/Superglobals" />
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="minimum" value="50" />
</properties>
</rule>
<rule ref="rulesets/design.xml/DepthOfInheritance" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/design.xml/GotoStatement" />
<rule ref="rulesets/design.xml/NumberOfChildren" />
<rule ref="rulesets/naming.xml/BooleanGetMethodName">
<properties>
<property name="checkParameterizedMethods" value="true" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="maximum" value="40" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName" />
<rule ref="rulesets/naming.xml/ShortVariable" >
<properties>
<property name="minimum" value="2" />
<property name="exceptions" value="e" />
</properties>
</rule>
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
<!-- Intentionally excluded rules, mentioned here for thoroughness -->
<!-- <rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> -->
<!-- <rule ref="rulesets/cleancode.xml/ElseExpression" /> -->
<!-- <rule ref="rulesets/cleancode.xml/StaticAccess" /> -->
<!-- <rule ref="rulesets/controversial.xml/CamelCaseClassName" /> -->
<!-- <rule ref="rulesets/controversial.xml/CamelCaseMethodName"> -->
<!-- <rule ref="rulesets/controversial.xml/CamelCasePropertyName"> -->
<!-- <rule ref="rulesets/controversial.xml/CamelCaseParameterName"> -->
<!-- <rule ref="rulesets/controversial.xml/CamelCaseVariableName"> -->
<!-- <rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> -->
<!-- <rule ref="rulesets/codesize.xml/ExcessivePublicCount" /> -->
<!-- <rule ref="rulesets/codesize.xml/NPathComplexity" /> -->
<!-- <rule ref="rulesets/codesize.xml/TooManyFields" /> -->
<!-- <rule ref="rulesets/codesize.xml/TooManyMethods" /> -->
<!-- <rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> -->
<!-- <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> -->
<!-- <rule ref="rulesets/codesize.xml/ExcessiveClassLength"> -->
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment