This ruleset is meant to be used on Magento projects and modules.
Custom rules are copied from https://github.com/magento/magento2/tree/2.4.5/dev/tests/static/framework/Magento/CodeMessDetector.
To use this ruleset, require it in composer:
composer require --dev smile/magento2-smilelab-phpmd
You can run phpmd with this command:
php vendor/bin/phpmd [src folder] text vendor/smile/magento2-smilelab-phpmd/ruleset.xml