Skip to content

Instantly share code, notes, and snippets.

@Tjitse-E
Created August 15, 2024 13:43
Show Gist options
  • Save Tjitse-E/e7c357e7cd094708bc50eb8ed9975ce8 to your computer and use it in GitHub Desktop.
Save Tjitse-E/e7c357e7cd094708bc50eb8ed9975ce8 to your computer and use it in GitHub Desktop.
Vendic's customized Magento phpmd config
<?xml version="1.0"?>
<ruleset name="PHPMD"
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>PHPMD</description>
<!-- Exclude files -->
<exclude-pattern>phpserver/*</exclude-pattern>
<exclude-pattern>app/(functions|bootstrap|autoload).php</exclude-pattern>
<exclude-pattern>app/etc/*</exclude-pattern>
<exclude-pattern>deploy.php</exclude-pattern>
<exclude-pattern>index.php</exclude-pattern>
<!-- Exclude tests -->
<exclude-pattern>dev/*</exclude-pattern>
<exclude-pattern>app/code/*/*/Test/Integration/*.php</exclude-pattern>
<!--Design-->
<rule ref="rulesets/design.xml/ExitExpression"/>
<rule ref="rulesets/design.xml/EvalExpression"/>
<rule ref="rulesets/design.xml/GotoStatement"/>
<rule ref="rulesets/design.xml/NumberOfChildren"/>
<rule ref="rulesets/design.xml/DepthOfInheritance"/>
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="maximum" value="25"/>
</properties>
</rule>
<rule ref="rulesets/design.xml/DevelopmentCodeFragment"/>
<rule ref="rulesets/design.xml/EmptyCatchBlock"/>
<rule ref="rulesets/design.xml/CountInLoopExpression"/>
<!-- Rulesets -->
<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/naming.xml">
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
<exclude name="LongClassName"/>
</rule>
<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter"/>
</rule>
<rule ref="rulesets/cleancode.xml">
<exclude name="BooleanArgumentFlag"/>
<exclude name="IfStatementAssignment"/>
</rule>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment