Skip to content

Commit cdb6f19

Browse files
committed
Add mess detector configuration and fix execution
1 parent ad7ec16 commit cdb6f19

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: composer-install up ## Install required software and initialize your l
1313
up: ## Start application containers and required services
1414
@bash -c "export MOCKSERVER_LOG_LEVEL=WARN; docker-compose up -d"
1515

16-
debug: ## Start application containers and required services
16+
debug: ## Start application containers and required services in debug mode
1717
@bash -c "export MOCKSERVER_LOG_LEVEL=INFO; docker-compose up -d"
1818

1919
down: ## Stop application containers and required services
@@ -32,7 +32,7 @@ code-find-bugs phpstan: ## Run static analysis tool to find possible bugs using
3232
@docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpstan analyse
3333

3434
code-find-smells md: ## Run static analysis tool to find code smells using mess detector
35-
@docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpmd src,tests text phpmd.xml --suffixes php --exclude src/Infrastructure/Persistence/Doctrine/Migrations,tests/_support,tests/acceptance
35+
@docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpmd src,tests text phpmd.xml --suffixes php
3636

3737
composer-update: ## Run composer update
3838
@docker run --rm --interactive --tty --volume $PWD:/app composer update

phpmd.xml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Default 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>Default PHPMD rule set</description>
9+
10+
<rule ref="rulesets/cleancode.xml">
11+
<exclude name="StaticAccess"/>
12+
</rule>
13+
14+
<rule ref="rulesets/controversial.xml">
15+
<exclude name="CamelCaseMethodName"/>
16+
</rule>
17+
18+
<rule ref="rulesets/controversial.xml/CamelCaseMethodName">
19+
<properties>
20+
<property name="allow-underscore" value="true"/>
21+
</properties>
22+
</rule>
23+
24+
<rule ref="rulesets/design.xml">
25+
<exclude name="CouplingBetweenObjects"/>
26+
<exclude name="NumberOfChildren"/>
27+
</rule>
28+
29+
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
30+
<properties>
31+
<property name="maximum" value="30"/>
32+
</properties>
33+
</rule>
34+
35+
<rule ref="rulesets/naming.xml">
36+
<exclude name="LongClassName"/>
37+
<exclude name="ShortVariable"/>
38+
<exclude name="LongVariable"/>
39+
<exclude name="ShortMethodName"/>
40+
</rule>
41+
<rule ref="rulesets/naming.xml/LongClassName">
42+
<properties>
43+
<property name="subtract-suffixes" value="Exception, Validator, Transformer, Test, Cest"/>
44+
</properties>
45+
</rule>
46+
<rule ref="rulesets/naming.xml/ShortVariable">
47+
<properties>
48+
<property name="exceptions">
49+
<value>id</value>
50+
</property>
51+
</properties>
52+
</rule>
53+
<rule ref="rulesets/naming.xml/LongVariable">
54+
<properties>
55+
<property name="maximum" value="40"/>
56+
</properties>
57+
</rule>
58+
<rule ref="rulesets/naming.xml/ShortMethodName">
59+
<properties>
60+
<property name="exceptions">
61+
<value>id</value>
62+
</property>
63+
</properties>
64+
</rule>
65+
66+
<rule ref="rulesets/unusedcode.xml"/>
67+
</ruleset>

0 commit comments

Comments
 (0)