Something went wrong. Try again.
code complexity & repetition analysis tool
Something went wrong. Try again.
Development #
Prerequisites #
- Rust and Cargo
justfor project recipesmdbookfor documentation work
Workspace #
This Rust workspace has two crates:
crates/core: library code for tokenization, loading, clone detection, complexity and LOC analysis, coverage parsing, highlighting, and reporting.crates/cli: themccabrecommand-line interface built withclap; command handlers live incrates/cli/src/commands/.
Common Commands #
cargo build --workspace
cargo test --workspace
cargo fmt --all
cargo clippy --workspace --all-targets
The justfile wraps the common local workflow:
just fmt
just test
just check
just docs-build
just docs-test
Run the CLI locally with Cargo:
cargo run -p mccabre -- loc crates/core
cargo run -p mccabre -- coverage report --from lcov.info
Coverage #
Mccabre uses cargo-llvm-cov for Rust test coverage.
Install the Cargo subcommand:
cargo +stable install cargo-llvm-cov --locked
Installing from source currently requires rustc 1.87 or later.
On macOS or Linux with Homebrew, brew install cargo-llvm-cov is also available.
Then run coverage through just:
# Print coverage in the terminal.
just coverage
# Write lcov.info for mccabre coverage commands.
just coverage-lcov
# Write an HTML report to coverage_html/.
just coverage-html
Coverage artifacts are ignored by git.
Documentation #
Keep documentation in docs/ up to date when behavior changes.
just docs-build
just docs-test
Serve the mdBook locally while editing:
just docs