diff --git a/composer.json b/composer.json index a18f6a2..e6a372f 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "phpdocumentor/phpdocumentor": "~2.0", "psy/psysh": "@stable", "loadsys/loadsys_codesniffer": "~3.0", - "nikic/php-parser": "~0.9" + "nikic/php-parser": "~0.9", + "phpmetrics/phpmetrics": "^1.10" }, "config": { "bin-dir": "bin" @@ -39,6 +40,7 @@ "git-localchanges", "git-remotechanges", "logs-clear", + "metrics-generate", "migrations", "nfsexports-setsudoaccess", "owner-set", diff --git a/metrics-generate b/metrics-generate new file mode 100755 index 0000000..1a47d32 --- /dev/null +++ b/metrics-generate @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +#--------------------------------------------------------------------- +usage () +{ + cat </dev/null 2>&1 && pwd )" +TMP_DIR="tmp" +REPORT_DIR="${TMP_DIR}/metrics" +REPORT_FILE="${REPORT_DIR}/index.html" +TARGET_FOLDERS=("./src") + +if [ $# -gt 0 ]; then + TARGET_FOLDERS=("$@") +fi + + +echo "## Generating metrics report."; +bin/phpmetrics \ + --report-html="$REPORT_FILE" \ + ${TARGET_FOLDERS[@]}