|
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 2 | +<ruleset name="PHPMD rule set" |
| 3 | + xmlns="http://pmd.sf.net/ruleset/1.0.0" |
| 4 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 5 | + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" |
| 6 | + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> |
| 7 | + |
| 8 | + <description>Base PHP Mess Detector Rule Set</description> |
| 9 | + |
| 10 | + |
| 11 | + <!-- ================== --> |
| 12 | + <!-- === Clean Code === --> |
| 13 | + <!-- ================== --> |
| 14 | + |
| 15 | + <!-- |
| 16 | + See: https://phpmd.org/rules/cleancode.html |
| 17 | +
|
| 18 | + The Clean Code ruleset contains rules that enforce a clean code base. |
| 19 | + This includes rules from SOLID and object calisthenics. |
| 20 | + --> |
| 21 | + <rule ref="rulesets/cleancode.xml"> |
| 22 | + <exclude name="StaticAccess"/> |
| 23 | + <exclude name="BooleanArgumentFlag"/> |
| 24 | + </rule> |
| 25 | + |
| 26 | + |
| 27 | + <!-- ================= --> |
| 28 | + <!-- === Code Size === --> |
| 29 | + <!-- ================= --> |
| 30 | + |
| 31 | + <!-- |
| 32 | + See: https://phpmd.org/rules/codesize.html |
| 33 | +
|
| 34 | + The Code Size Ruleset contains a collection of rules that find code size related problems. |
| 35 | + --> |
| 36 | + <rule ref="rulesets/codesize.xml"> |
| 37 | + <exclude name="TooManyPublicMethods"/> |
| 38 | + <exclude name="ExcessiveClassComplexity"/> |
| 39 | + <exclude name="TooManyMethods"/> |
| 40 | + </rule> |
| 41 | + |
| 42 | + <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"> |
| 43 | + <properties> |
| 44 | + <property name="maximum" value="100"/> |
| 45 | + </properties> |
| 46 | + </rule> |
| 47 | + |
| 48 | + <rule ref="rulesets/codesize.xml/TooManyMethods"> |
| 49 | + <properties> |
| 50 | + <property name="maxmethods" value="50"/> |
| 51 | + </properties> |
| 52 | + </rule> |
| 53 | + |
| 54 | + <!-- |
| 55 | + Violations of this rule usually indicate that the method is doing too much. |
| 56 | + Try to reduce the method size by creating helper methods and removing any copy/pasted code. |
| 57 | + --> |
| 58 | + <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"> |
| 59 | + <properties> |
| 60 | + <property name="minimum" value="100"/> |
| 61 | + </properties> |
| 62 | + </rule> |
| 63 | + |
| 64 | + |
| 65 | + <!-- =========================== --> |
| 66 | + <!-- === Controversial Rules === --> |
| 67 | + <!-- =========================== --> |
| 68 | + |
| 69 | + <!-- |
| 70 | + See: https://phpmd.org/rules/controversial.html |
| 71 | +
|
| 72 | + This ruleset contains a collection of controversial rules. |
| 73 | + --> |
| 74 | + <rule ref="rulesets/controversial.xml"> |
| 75 | + <exclude name="CamelCaseVariableName"/> |
| 76 | + </rule> |
| 77 | + |
| 78 | + |
| 79 | + <!-- ==================== --> |
| 80 | + <!-- === Design Rules === --> |
| 81 | + <!-- ==================== --> |
| 82 | + |
| 83 | + <!-- |
| 84 | + See: https://phpmd.org/rules/design.html |
| 85 | +
|
| 86 | + The Design Ruleset contains a collection of rules that find software design related problems. |
| 87 | + --> |
| 88 | + <rule ref="rulesets/design.xml"/> |
| 89 | + |
| 90 | + <rule ref="rulesets/design.xml/CouplingBetweenObjects"> |
| 91 | + <properties> |
| 92 | + <property name="minimum" value="15"/> |
| 93 | + </properties> |
| 94 | + </rule> |
| 95 | + |
| 96 | + |
| 97 | + <!-- ==================== --> |
| 98 | + <!-- === Naming Rules === --> |
| 99 | + <!-- ==================== --> |
| 100 | + |
| 101 | + <!-- |
| 102 | + See: https://phpmd.org/rules/naming.html |
| 103 | +
|
| 104 | + The Naming Ruleset contains a collection of rules about names - too long, too short, and so forth. |
| 105 | + --> |
| 106 | + <rule ref="rulesets/naming.xml"> |
| 107 | + <exclude name="ShortVariable"/> |
| 108 | + <exclude name="LongVariable"/> |
| 109 | + <exclude name="ShortMethodName"/> |
| 110 | + </rule> |
| 111 | + |
| 112 | + <rule ref="rulesets/naming.xml/ShortVariable"> |
| 113 | + <properties> |
| 114 | + <property name="minimum" value="2"/> |
| 115 | + </properties> |
| 116 | + </rule> |
| 117 | + |
| 118 | + <rule ref="rulesets/naming.xml/LongVariable"> |
| 119 | + <properties> |
| 120 | + <property name="maximum" value="30"/> |
| 121 | + </properties> |
| 122 | + </rule> |
| 123 | + |
| 124 | + <rule ref="rulesets/naming.xml/ShortMethodName"> |
| 125 | + <properties> |
| 126 | + <property name="minimum" value="2"/> |
| 127 | + </properties> |
| 128 | + </rule> |
| 129 | + |
| 130 | + <rule ref="rulesets/naming.xml/BooleanGetMethodName"> |
| 131 | + <properties> |
| 132 | + <property name="checkParameterizedMethods" value="true"/> |
| 133 | + </properties> |
| 134 | + </rule> |
| 135 | + |
| 136 | + |
| 137 | + <!-- ========================= --> |
| 138 | + <!-- === Unused Code Rules === --> |
| 139 | + <!-- ========================= --> |
| 140 | + |
| 141 | + <!-- |
| 142 | + See: https://phpmd.org/rules/unusedcode.html |
| 143 | +
|
| 144 | + The Unused Code Ruleset contains a collection of rules that find unused code. |
| 145 | + --> |
| 146 | + <rule ref="rulesets/unusedcode.xml"/> |
| 147 | + |
| 148 | +</ruleset> |
0 commit comments