I think the problem is that you installed phpmd in a local directory, but you are trying to use it as if it was installed globally.
Installation instructions on linked sites may not be more understandable. Since you have already installed phpcs and php-cs-fixer and they work for you, just follow the same instructions for phpmd. These are all PHP projects and are installed in the same way.
In any case, to use phpmd as a global command, you have several options.
Github
Hide the github repository just like you do, and add the phpmd bin directory to your PATH variable .
Global Composer Installation
Use the global command command to install phpmd worldwide. You also need to make sure that the bin directory for the composer is in PATH . By default it is ~/.composer/vendor/bin .
composer global require phpmd/phpmd
This command will install phpmd globally, and once ~/.composer/vendor/bin is in your PATH , you can invoke it simply by calling phpmd .
This is very well explained in the composer's documentation: https://getcomposer.org/doc/03-cli.md#global
Download phar archive
This is the easiest thing you can do. Just go to the phpmd releases page, select the latest one and upload it to the phar archive .
Put the phar file anywhere. Just remember that this should be in your PATH . You can also rename it to skip the .phar extension.
For example:
wget http://static.phpmd.org/php/2.1.3/phpmd.phar sudo mv phpmd.phar /usr/bin/phpmd sudo chmod +x /usr/bin/phpmd
Dock container
First select the docker image using the static analysis tools for PHP :
git pull jakzal/phpqa
One of the tools provided by the image is phpmd. The command below starts phpmd in the docker container and mounts the current working directory as / project.
docker run -it --rm -v $(pwd):/project -w /project jakzal/phpqa \ phpmd src text cleancode,codesize,controversial,design,naming,unusedcode