{"repo":"minikin/cargo-crap","free":true,"listed":false,"github":"https://github.com/minikin/cargo-crap","clone":"git clone https://github.com/minikin/cargo-crap.git","description":"Change Risk Anti-Patterns (CRAP) metric for Rust projects","language":"Rust","stars":380,"topics":["agents","rust","anti-patterns","risk-analysis","cargo-plugin","code-quality","complexity","metrics"],"license":"MIT","category":"ai-agents","readme_excerpt":"cargo-crap [!TIP] For more context on the motivation behind this crate, read: cargo-crap: Finding Untested Complexity in AI-Generated Rust Code or watch Your AI Code Might Be CRAP! (Here's How To Fix It). Compute the CRAP (Change Risk Anti-Patterns) metric for Rust projects. CRAP combines cyclomatic complexity and test coverage into a single number that is high when code is both hard to understand and poorly tested — i.e. where bugs love to hide. The metric was introduced by Savoia & Evans in 2007 and was originally implemented for Java (Crap4j) and .NET (NDepend). cargo-crap brings it to the Rust ecosystem. A few properties worth internalizing before you use the output: - A trivial function (CC=1, 100% covered) scores exactly 1.0. That's the lower bound. - At 100% coverage the quadratic term collapses and CRAP equals CC . When you see matching values in those two columns, that function is fully covered — tests are capping the damage, but the complexity itself remains. It's a good sign, not a bug. - Above CC ≈ 30 no amount of coverage keeps you under the default threshold of 30. That's not a bug in the formula — it's the formula saying \"this function is too big to certify as clean, regardless of tests.\" Install Via cargo binstall (downloads the right pre-built binary automatically): From source (requires Rust stable ≥ 1.88): From the AUR : Pre-built binary (manual download): Windows: download cargo-crap-x86 64-pc-windows-msvc.zip from the latest release and extract cargo-crap","default_branch":null,"files":null,"tree":[],"storefront":"/r/minikin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/minikin/cargo-crap/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}