srcmetrics-cli 0.2.0

Command-line tool and local HTTP API for srcmetrics: analyze source code, export metrics as JSON/CSV, statistics and HTML reports
srcmetrics-cli-0.2.0 is not a library.

srcmetrics

English | 日本語

Language-independent source code metrics for C, C++, Go, Java, JavaScript, Python, Rust and TypeScript.

srcmetrics measures size, control-flow complexity, nesting, Halstead measures, duplication, call dependencies and documentation with one definition for every language, and reports each metric separately — as raw features for statistical analysis, not as a single "readability score". A value that cannot be computed is null with its reason, never 0.

Documentation: https://lunainsidious.github.io/srcmetrics/

Install

cargo install srcmetrics-cli   # the `srcmetrics` command
cargo add srcmetrics           # the library

Quick start

srcmetrics analyze src -o result.json          # metrics per project, file and function (JSON; --format csv)
srcmetrics report result.json -o report.html   # self-contained HTML report
let result = srcmetrics::analyze::analyze_source("example.py", "def f(x):\n    return x if x else 0\n")?;

Links

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.