@@ -16,50 +16,43 @@ $ npx code-complexity <path-to-git-directory>
1616## Help
1717
1818``` sh
19- Usage: code-complexity < dir> [options]
20-
21- Measure projects complexity based on files sloc and commit count.
22-
23- Options:
24- -l, --limit [limit] Limit the number of files to output
25- -d, --details Show the number of commit and computed sloc
26- -c, --commit Show the number of commits
27- -s, --sloc Show the computed sloc
28- -i, --since [since] Limit the age of the commit analyzed
29- -n, --no-first-parent Do not use the git-log flag ' --first-parent' when counting commits
30- --sort [sort] Sort results by commit, complexity, file or sloc
31- --min [min] Exclude results below < min>
32- --max [max] Exclude results above < max>
33- --excludes < strings> List of strings (comma separated) used in filenames to exclude
34- (executed after ' --includes' ) (default: [])
35- --includes < strings> List of strings (comma separated) used in filenames to include
36- (executed before ' --excludes' ) (default: [])
37- -h, --help display help for command
38-
39- Examples:
40-
19+ Usage: code-complexity < dir> [options]
20+
21+ Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.
22+
23+ Options:
24+ -V, --version output the version number
25+ --filter < strings> list of globs (comma separated) to filter
26+ -f, --format [format] format results using table or json
27+ -l, --limit [limit] limit the number of files to output
28+ -i, --since [since] limit the age of the commit analyzed
29+ -s, --sort [sort] sort results (allowed valued: ratio,
30+ churn, complexity or file)
31+ -h, --help display help for command
32+
33+ Examples:
34+
4135 $ code-complexity < dir>
4236 $ code-complexity < dir> --limit 3
43- $ code-complexity < dir> --details
44- $ code-complexity < dir> --min 10 --max 50
45- $ code-complexity < dir> --sort complexity
46- $ code-complexity < dir> --excludes lib,test
47- $ code-complexity < dir> --includes users
48- $ code-complexity < dir> --details --limit 10 --sort complexity --excludes test
37+ $ code-complexity < dir> --sort ratio
38+ $ code-complexity < dir> --filter ' src/**' ,' !src/front'
39+ $ code-complexity < dir> --limit 10 --sort ratio
4940```
5041
5142## Output
5243
5344``` sh
54- $ npx code-complexity . --details -- sort complexity --limit 10
45+ $ npx code-complexity . --sort=ratio --limit=3
5546
56- test/code-complexity.test.ts 535 (commits: 5, sloc: 107)
57- src/cli.ts 402 (commits: 6, sloc: 67)
58- src/services/prepare-stdout.ts 348 (commits: 4, sloc: 87)
59- src/services/compute-complexity.ts 108 (commits: 4, sloc: 27)
60- src/services/count-commits-per-file.ts 83 (commits: 1, sloc: 83)
61- src/services/compute-complexity-per-file.ts 36 (commits: 1, sloc: 36)
62- .eslintrc.js 19 (commits: 1, sloc: 19)
47+ ┌──────────────────────────────┬────────────┬───────┬───────┐
48+ │ file │ complexity │ churn │ ratio │
49+ ├──────────────────────────────┼────────────┼───────┼───────┤
50+ │ src/cli.ts │ 103 │ 8 │ 824 │
51+ ├──────────────────────────────┼────────────┼───────┼───────┤
52+ │ test/code-complexity.test.ts │ 107 │ 7 │ 749 │
53+ ├──────────────────────────────┼────────────┼───────┼───────┤
54+ │ .idea/workspace.xml │ 123 │ 6 │ 738 │
55+ └──────────────────────────────┴────────────┴───────┴───────┘
6356```
6457
6558## Troubleshooting
0 commit comments