braintax 0.1.0

A minimal cognitive tax estimator — quantify how mentally taxing code patterns are.
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented1 out of 6 items with examples
  • Size
  • Source code size: 7.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2m 5s Average build duration of successful builds.
  • all releases: 2m 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • umbgtt10/braintax4rust
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • umbgtt10

braintax

A minimal cognitive tax estimator — quantify how mentally taxing code patterns are.

braintax provides a simple scoring function that combines nesting depth and branching complexity into a single heuristic value. It is designed as a lightweight companion to complexity analysis tools like crap4rust.

Formula

tax = nesting² + branches + 1

A score of 1 represents the baseline (no nesting, no branches). Higher scores indicate increasing mental taxation.

Usage

use braintax::Braintax;

let score = Braintax::new()
    .with_nesting(3)
    .with_branches(5)
    .compute();

assert_eq!(score, 15); // 3² + 5 + 1 = 15

License

Licensed under MIT or Apache-2.0 at your option.