@@ -32,15 +32,15 @@ $ npx code-complexity <path-to-git-directory or URL>
32
32
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
33
33
34
34
Options:
35
- -V, --version output the version number
36
- --filter <strings> list of globs (comma separated) to filter
37
- -f , --format [format] format results using table, json or csv
38
- -l , --limit [limit ] limit the number of files to output
39
- -i , --since [since ] limit analysis to commits more recent in age than date
40
- -u , --until [until ] limit analysis to commits older in age than date
41
- -s , --sort [sort ] sort results (allowed valued: score,
42
- churn, complexity or file)
43
- -h, --help display help for command
35
+ -V, --version output the version number
36
+ --filter <strings> list of globs (comma separated) to filter
37
+ -cs , --complexity-strategy [strategy] choose the complexity strategy to analyze your codebase with (allowed values: sloc, cyclomatic, halstead).
38
+ -f , --format [format ] format results using table, json or csv
39
+ -l , --limit [limit ] limit the number of files to output
40
+ -i , --since [since ] limit analysis to commits more recent in age than date
41
+ -u , --until [until ] limit analysis to commits older in age than date
42
+ -s, --sort [sort] sort results (allowed valued: score, churn, complexity or file)
43
+ -h, --help display help for command
44
44
45
45
Examples:
46
46
@@ -50,10 +50,15 @@ $ npx code-complexity <path-to-git-directory or URL>
50
50
$ code-complexity ../foo --sort score
51
51
$ code-complexity /foo/bar --filter 'src/**,!src/front/**'
52
52
$ code-complexity . --limit 10 --sort score
53
+ $ code-complexity . --limit 10 --sort score -cs halstead
53
54
$ code-complexity . --since=2021-06-01 --limit 100
54
55
$ code-complexity . --since=2021-04-01 --until=2021-07-01
55
56
```
56
57
58
+ ## Notes
59
+
60
+ The Halstead metrics are a [ collection of several metrics] ( https://en.wikipedia.org/wiki/Halstead_complexity_measures ) , we use the "volume" metric.
61
+
57
62
## Output
58
63
59
64
``` sh
@@ -70,9 +75,11 @@ $ npx code-complexity https://github.com/simonrenoult/code-complexity --sort=sco
70
75
└──────────────────────────────┴────────────┴───────┴───────┘
71
76
```
72
77
73
- ## Troubleshooting
78
+ ## Special thanks
79
+
80
+ A special thanks to a few contributors that helped me make ` code-complexity ` better.
74
81
75
- + ` Error: stdout maxBuffer exceeded ` : use the flag ` --since ` to limit the number of commits to analyze .
82
+ - Alexander Dormann (alexdo) for fixing the ` ENOBUFS ` (and apologies for stealing your code) .
76
83
77
84
[ michael-feathers-source ] :https://www.stickyminds.com/article/getting-empirical-about-refactoring
78
85
[ travis-image ] :https://img.shields.io/travis/simonrenoult/code-complexity/master.svg?style=flat-square
@@ -83,9 +90,3 @@ $ npx code-complexity https://github.com/simonrenoult/code-complexity --sort=sco
83
90
[ coverage-url ] : https://codecov.io/gh/simonrenoult/code-complexity/branch/master
84
91
[ npm-image ] : https://img.shields.io/npm/v/code-complexity.svg?style=flat-square
85
92
[ npm-url ] : https://www.npmjs.com/package/code-complexity
86
-
87
- ## Special thanks
88
-
89
- A special thanks to a few contributors that helped me make ` code-complexity ` better.
90
-
91
- - Alexander Dormann (alexdo) for fixing the ` ENOBUFS ` (and apologies for stealing your code).
0 commit comments