mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-09-16 21:36:17 +02:00

[FEATURE] Add PHP mess detector (#1391)

Resolves: #128
This commit is contained in:
Eike Starkmann 2024-07-31 12:54:03 +02:00 committed by GitHub
parent 948505011c
commit 6c8f0176c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 0 deletions

View file

@ -82,6 +82,7 @@ jobs:
- "composer:unused"
- "json:lint"
- "php:cs-fixer"
- "php:mess"
- "php:sniff"
- "php:stan"
- "typoscript:lint"

33
Build/phpmd/phpmd.xml Normal file
View file

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<ruleset name="phpList">
<description>
PHPMD rules for Tea
</description>
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>
<rule ref="rulesets/codesize.xml/NPathComplexity"/>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>
<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>
<rule ref="rulesets/codesize.xml/TooManyFields"/>
<rule ref="rulesets/codesize.xml/TooManyMethods"/>
<rule ref="rulesets/codesize.xml/TooManyPublicMethods"/>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"/>
<rule ref="rulesets/controversial.xml/Superglobals"/>
<rule ref="rulesets/design.xml/ExitExpression"/>
<rule ref="rulesets/design.xml/EvalExpression"/>
<rule ref="rulesets/design.xml/GotoStatement"/>
<rule ref="rulesets/design.xml/NumberOfChildren"/>
<rule ref="rulesets/design.xml/DepthOfInheritance"/>
<rule ref="rulesets/design.xml/CouplingBetweenObjects"/>
<rule ref="rulesets/design.xml/DevelopmentCodeFragment"/>
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
</ruleset>

View file

@ -53,6 +53,7 @@
"icanhazstring/composer-unused": "^0.8.11",
"php-coveralls/php-coveralls": "^2.7.0",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpmd/phpmd": "^2.15.0",
"phpstan/extension-installer": "^1.4.1",
"phpstan/phpstan": "^1.11.8",
"phpstan/phpstan-phpunit": "^1.4.0",
@ -146,6 +147,7 @@
],
"ci:php:cs-fixer": "php-cs-fixer fix --config .php-cs-fixer.php -v --dry-run --diff",
"ci:php:lint": "parallel-lint .*.php *.php Classes Configuration Tests",
"ci:php:mess": "phpmd Classes text Build/phpmd/phpmd.xml",
"ci:php:sniff": "phpcs Classes Configuration Tests",
"ci:php:stan": "phpstan --no-progress",
"ci:static": [
@ -218,6 +220,7 @@
"ci:php": "Runs all static checks for the PHP files.",
"ci:php:cs-fixer": "Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer).",
"ci:php:lint": "Lints the PHP files for syntax errors.",
"ci:php:mess": "Runs PHP mess detection.",
"ci:php:sniff": "Checks the code style with PHP_CodeSniffer (PHPCS).",
"ci:php:stan": "Checks the PHP types using PHPStan.",
"ci:static": "Runs all static code checks (syntax, style, types).",