code-complexity
Measure the churn/complexity score. Higher values mean hotspots where
refactorings should happen.

Quoting Michael Feathers (source here):
Often when we refactor, we look at local areas of code. If we take a wider
view, using information from our version control systems, we can get a better
sense of the effects of our refactoring efforts.
Note: code-complexity
currently measures complexity using lines of code count.
While imperfect, this measure gives a good enough idea of what's going on.
Usage
$ npx code-complexity <path-to-git-directory or URL>
Help
Usage: code-complexity <target> [options]
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
Options:
-V, --version output the version number
--filter <strings> list of globs (comma separated) to filter
-f, --format [format] format results using table, json or csv
-l, --limit [limit] limit the number of files to output
-i, --since [since] limit analysis to commits more recent in age than date
-u, --until [until] limit analysis to commits older in age than date
-s, --sort [sort] sort results (allowed valued: score,
churn, complexity or file)
-h, --help display help for command
Examples:
$ code-complexity .
$ code-complexity https://github.com/simonrenoult/code-complexity
$ code-complexity foo --limit 3
$ code-complexity ../foo --sort score
$ code-complexity /foo/bar --filter 'src/**,!src/front/**'
$ code-complexity . --limit 10 --sort score
$ code-complexity . --since=2021-06-01 --limit 100
$ code-complexity . --since=2021-04-01 --until=2021-07-01
Output
$ npx code-complexity https://github.com/simonrenoult/code-complexity --sort=score --limit=3
ββββββββββββββββββββββββββββββββ¬βββββββββββββ¬ββββββββ¬ββββββββ
β file β complexity β churn β score β
ββββββββββββββββββββββββββββββββΌβββββββββββββΌββββββββΌββββββββ€
β src/cli.ts β 103 β 8 β 824 β
ββββββββββββββββββββββββββββββββΌβββββββββββββΌββββββββΌββββββββ€
β test/code-complexity.test.ts β 107 β 7 β 749 β
ββββββββββββββββββββββββββββββββΌβββββββββββββΌββββββββΌββββββββ€
β .idea/workspace.xml β 123 β 6 β 738 β
ββββββββββββββββββββββββββββββββ΄βββββββββββββ΄ββββββββ΄ββββββββ
Troubleshooting
Error: stdout maxBuffer exceeded
: use the flag --since
to limit the number of commits to analyze.