-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpmd.xml
48 lines (40 loc) · 1.52 KB
/
phpmd.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
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>
php 规范自定义规则
</description>
<!--载入所有 cleancode 规则,除去 StaticAccess-->
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess" />
</rule>
<!--类中的 public 方法个数-->
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
<properties>
<property name="maxmethods" value="15" />
</properties>
</rule>
<!-- 载入所有 naming 规则,除了下面两个规则 -->
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
<exclude name="LongVariable" />
</rule>
<!--无用代码检测-->
<rule ref="rulesets/unusedcode.xml" />
<!--代码设计相关问题-->
<rule ref="rulesets/design.xml" />
<!-- 具有争议的规则 -->
<rule ref="rulesets/controversial.xml">
<!--排除超全局变量-->
<!--<exclude name="Superglobals" />-->
<!--排除驼峰变量-->
<!--<exclude name="CamelCaseVariableName" />-->
<!--排除驼峰方法名-->
<!--<exclude name="CamelCaseMethodName" />-->
</rule>
</ruleset>