-
Notifications
You must be signed in to change notification settings - Fork 18
phpmd
Scott Dutton edited this page Dec 2, 2017
·
1 revision
All of the commands can read from stdin with placeholder -
phpmd src/ xml cleancode | ./vendor/bin/diffFilter --phpmd /tmp/diff.txt -
phpmd can be run with any options you normally have for example cleancode,codesize,controversial
phpmd also has a strict mode --phpmdStrict
instead of --phpmd
which reports an error multiple times for each line which is not standard. The normal mode reports the error once, eg a class has too many functions, strict mode reports this violation on each line. This makes old non conforming files easier to deal with as refactoring can be risky also.
This will exit with code 2 if any of the new/edited code fails the code standards check. The output is kept so you can see what the offending lines are and what the error is.