Skip to content

Commit cf8bf72

Browse files
committed
Code Quality - add new settings to phpmd and codeclimate
1 parent 5e026fc commit cf8bf72

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.codeclimate.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ plugins:
3333
config:
3434
file_extensions:
3535
- php
36+
rulesets: "phpmd.xml"
3637

phpmd.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Ruleset"
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+
<description>Ruleset for PHP Mess Detector that enforces coding standards</description>
7+
8+
<rule ref="rulesets/codesize.xml"/>
9+
10+
<rule ref="rulesets/controversial.xml"/>
11+
12+
<rule ref="rulesets/design.xml"/>
13+
14+
<rule ref="rulesets/unusedcode.xml">
15+
<!-- PHPMD cannot recognize parameters that are enforced by an interface -->
16+
<exclude name="UnusedFormalParameter"/>
17+
</rule>
18+
19+
<!-- Import entire naming rule set and exclude rules -->
20+
<rule ref="rulesets/naming.xml">
21+
<exclude name="ShortVariable" />
22+
<exclude name="LongVariable" />
23+
</rule>
24+
25+
<!-- Import entire clean code rule set, modify StaticAccess rule -->
26+
<rule ref="rulesets/cleancode.xml">
27+
<exclude name="StaticAccess" />
28+
</rule>
29+
<rule ref="rulesets/cleancode.xml/StaticAccess">
30+
<properties>
31+
<property name="exceptions">
32+
<value>
33+
\DateTime,
34+
\DateInterval,
35+
\DateTimeZone,
36+
\Phar,
37+
\TikiManager\Config\App,
38+
\TikiManager\Config\Environment,
39+
</value>
40+
</property>
41+
</properties>
42+
</rule>
43+
</ruleset>

0 commit comments

Comments
 (0)