diff --git a/composer.json b/composer.json index e6d27b7a3f..9bc2219a94 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,8 @@ }, "scripts": { "post-update-cmd": [ - "CodeIgniter\\ComposerScripts::postUpdate" + "CodeIgniter\\ComposerScripts::postUpdate", + "composer update --working-dir=tools/phpmetrics" ], "analyze": [ "Composer\\Config::disableProcessTimeout", @@ -111,12 +112,14 @@ ], "sa": "@analyze", "style": "@cs-fix", - "test": "phpunit" + "test": "phpunit", + "metrics": "tools/phpmetrics/vendor/bin/phpmetrics --config=phpmetrics.json" }, "scripts-descriptions": { "analyze": "Run static analysis", "cs": "Check the coding style", "cs-fix": "Fix the coding style", - "test": "Run unit tests" + "test": "Run unit tests", + "metrics": "Run PhpMetrics" } } diff --git a/phpmetrics.json b/phpmetrics.json new file mode 100644 index 0000000000..3ff72a6691 --- /dev/null +++ b/phpmetrics.json @@ -0,0 +1,7 @@ +{ + "includes": ["system"], + "excludes": ["ThirdParty"], + "report": { + "html": "build/phpmetrics/" + } +} diff --git a/tools/phpmetrics/composer.json b/tools/phpmetrics/composer.json new file mode 100644 index 0000000000..eef46d0db1 --- /dev/null +++ b/tools/phpmetrics/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "phpmetrics/phpmetrics": "^3.0rc6" + } +}