Skip to content

Commit 3f527c5

Browse files
Adds mess detector
1 parent 3a1e26c commit 3f527c5

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "~9.5.20",
23-
"phpmd/phpmd": "^2.12.0",
23+
"phpmd/phpmd": "^2.13",
2424
"phpstan/phpstan": "^1.6.8",
2525
"squizlabs/php_codesniffer": "~3.7.0",
2626
"magento/magento-coding-standard": "*",
2727
"phpcompatibility/php-compatibility": "^9.3",
2828
"slevomat/coding-standard": "^8.8",
29-
"sebastian/phpcpd": "^6.0"
29+
"sebastian/phpcpd": "^6.0",
30+
"pdepend/pdepend": "^2.13"
3031
},
3132
"repositories": [
3233
{
@@ -59,6 +60,7 @@
5960
"phpstan": "phpstan",
6061
"sniffer": "vendor/bin/phpcs --colors -p ./src --standard=phpcs-ruleset.xml",
6162
"fix-style": "vendor/bin/phpcbf --colors -p ./src --standard=phpcs-ruleset.xml",
62-
"sniffer:php8.1": "vendor/bin/phpcs -p ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1"
63+
"sniffer:php8.1": "vendor/bin/phpcs -p ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1",
64+
"mess-detector": "vendor/bin/phpmd src html phpmd-ruleset.xml --exclude \"Test\" --strict --reportfile reports/phpmd/phpmd.html"
6365
}
6466
}

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpmd-ruleset.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="run_as_root Magento PHP Mess Detector Ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
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">
4+
<description>
5+
run_as_root Magento PHP Mess Detector Ruleset
6+
</description>
7+
<exclude-pattern>*Test.php</exclude-pattern>
8+
<exclude-pattern>vendor</exclude-pattern>
9+
10+
<rule ref="rulesets/cleancode.xml">
11+
<exclude name="BooleanArgumentFlag" />
12+
<exclude name="StaticAccess"/>
13+
</rule>
14+
15+
<rule ref="rulesets/codesize.xml" />
16+
17+
<rule ref="rulesets/controversial.xml">
18+
<exclude name="CamelCaseMethodName"/>
19+
<exclude name="CamelCasePropertyName"/>
20+
</rule>
21+
22+
<rule ref="rulesets/design.xml">
23+
<exclude name="CouplingBetweenObjects" />
24+
</rule>
25+
26+
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
27+
<priority>1</priority>
28+
<properties>
29+
<property name="maximum" value="20" />
30+
</properties>
31+
</rule>
32+
33+
<rule ref="rulesets/naming.xml">
34+
<exclude name="ShortVariable" />
35+
<exclude name="LongVariable" />
36+
<exclude name="CamelCaseClassName"/>
37+
</rule>
38+
39+
<rule ref="rulesets/unusedcode.xml">
40+
<exclude name="UnusedFormalParameter"/>
41+
</rule>
42+
</ruleset>

0 commit comments

Comments
 (0)