🦄 Analysis per directory, wow! 🦄
Make analyze available for directories in addition to files, eg npx code-complexity https://github.com/simonrenoult/code-complexity --directories
.
This command will group results per directory, which is interesting in two ways:
- complexity might be hidden behind several averagely complex files within the same module
- it also opens new way of analyzing cohesion and coupling (for future releases).
Example of output:
$ npx code-complexity https://github.com/simonrenoult/code-complexity --directories --limit 5 --sort score
┌──────────┬────────────┬───────┬───────┐
│ file │ complexity │ churn │ score │
├──────────┼────────────┼───────┼───────┤
│ src │ 622 │ 58 │ 36076 │
├──────────┼────────────┼───────┼───────┤
│ test │ 582 │ 26 │ 15132 │
├──────────┼────────────┼───────┼───────┤
│ src/lib │ 376 │ 30 │ 11280 │
├──────────┼────────────┼───────┼───────┤
│ .idea │ 474 │ 22 │ 10428 │
├──────────┼────────────┼───────┼───────┤
│ test/lib │ 400 │ 14 │ 5600 │
└──────────┴────────────┴───────┴───────┘