
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
code-complexity
Advanced tools
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
Measure the churn/complexity score. Higher scores reveal 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.
$ npx code-complexity <path-to-git-directory or URL> [options]
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
-cs, --complexity-strategy [strategy] choose the complexity strategy to analyze your codebase with (allowed values: sloc, cyclomatic, halstead).
-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 . --limit 10 --modules
$ code-complexity . --limit 10 --sort score -cs halstead
$ code-complexity . --since=2021-06-01 --limit 100
$ code-complexity . --since=2021-04-01 --until=2021-07-01
$ 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 ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāā“āāāāāāāā“āāāāāāāā
A special thanks to a few contributors that helped me make code-complexity
better.
ENOBUFS
(and apologies for stealing your code).FAQs
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
The npm package code-complexity receives a total of 8,077 weekly downloads. As such, code-complexity popularity was classified as popular.
We found that code-complexity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.