'PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

I'm trying to use PHPMetrics within Docker image.

I run the next command in the project root folder:

docker run --rm -v `pwd`:/project jolicode/phaudit phpmetrics --report-html=var/artefacts/phpmetrics --excluded-dirs="myfolder" /project

It works fine and the report is correctly generated, but the option excluded-dirs is not interpreted. All PHP class files in the folder "myfolder" are in the HTML report...

The vendor directory is correctly excluded by default.

I've tried without success:

--excluded-dirs='myfolder'
--excluded-dirs=myfolder
--excluded-dirs="./myfolder"
--excluded-dirs="myfolder/"
--excluded-dirs="project/myfolder"


Solution 1:[1]

I add the exclude into the command as show below the additional parameter:

vendor/bin/phpmetrics --report-html=report_folder/ project/ --exclude="lib"

Its working fine for me. You can comma seperate the excludes too, e.g.

--exclude="lib","data","storage"

Hope this helps!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Russell Mazonde