PHP Mess Detector is an automated tool that is going to parse the code looking mainly for too complex code.
composer require phpmd/phpmd:@stable