File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1313 "phpdocumentor/phpdocumentor" : " ~2.0" ,
1414 "psy/psysh" : " @stable" ,
1515 "loadsys/loadsys_codesniffer" : " ~3.0" ,
16- "nikic/php-parser" : " ~0.9"
16+ "nikic/php-parser" : " ~0.9" ,
17+ "phpmetrics/phpmetrics" : " ^1.10"
1718 },
1819 "config" : {
1920 "bin-dir" : " bin"
3940 " git-localchanges" ,
4041 " git-remotechanges" ,
4142 " logs-clear" ,
43+ " metrics-generate" ,
4244 " migrations" ,
4345 " nfsexports-setsudoaccess" ,
4446 " owner-set" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # ---------------------------------------------------------------------
4+ usage ()
5+ {
6+ cat << EOT
7+
8+ ${0##*/ }
9+ Wraps up the call to the PHPMetrics library for standard Cake
10+ project folder layouts. Writes reports into the tmp/metrics/
11+ folder.
12+
13+ Should be run from the project root folder.
14+
15+ Usage:
16+ bin/${0##*/ }
17+
18+
19+ EOT
20+
21+ exit ${1:- 0} # Exit with code 0 unless an arg is passed to the method.
22+ }
23+ if [ " $1 " = ' -h' ]; then
24+ usage
25+ fi
26+
27+
28+ # Set up local variables.
29+ umask a+rw
30+
31+ DIR=" $( cd -P " $( dirname " $0 " ) " /.. > /dev/null 2>&1 && pwd ) "
32+ TMP_DIR=" tmp"
33+ REPORT_DIR=" ${TMP_DIR} /metrics"
34+ REPORT_FILE=" ${REPORT_DIR} /index.html"
35+ TARGET_FOLDERS=(" ./src" )
36+
37+ if [ $# -gt 0 ]; then
38+ TARGET_FOLDERS=(" $@ " )
39+ fi
40+
41+
42+ echo " ## Generating metrics report." ;
43+ bin/phpmetrics \
44+ --report-html=" $REPORT_FILE " \
45+ ${TARGET_FOLDERS[@]}
You can’t perform that action at this time.
0 commit comments