qc-cli 0.4.0

qc is designed to give you an instant breakdown of your codebase composition. It uses Memory Mapping (Mmap) and Parallel Directory Walking to scan tens of thousands of files in milliseconds.
qc-cli-0.4.0 is not a library.

qc (Quick Count) 🚀

A faster source code auditor and line counter built in Rust.

qc is designed to give you an instant breakdown of your codebase composition. It uses Memory Mapping (Mmap) and Parallel Directory Walking to scan thousands of files in milliseconds.

Benchmarks

In a head-to-head comparison against tokei on the Linux Kernel source tree, qc performed ~1.8x faster over 100 runs.

Tool Mean Time
qc 568.9 ms
tokei 1032 ms

Features

  • High Performance: Leverages all CPU cores and memory-mapped I/O for maximum throughput.
  • Deep Insights: Provides line counts for Code, Comments, and Blank lines.
  • Language Breakdown: Automatically identifies and categorizes files by extension.
  • Smart Composition: Visualizes the ratio of code vs. comments with a terminal heatmap.
  • Respectful: Automatically respects .gitignore and hidden files (powered by ignore).

Installation

From Source

Ensure you have the Rust toolchain installed.

  1. Clone the repository:

    git clone https://github.com/toast1599/qc.git
    cd qc
    
  2. Build and install using the Makefile:

    make install
    

    This will place the qc binary in your ~/.cargo/bin directory.

Usage

Run qc in any directory to start an audit:

qc .

Options

  • qc [path] - Scan a specific directory.
  • qc -<number> - Limit the "Top Files" list to N results (e.g., qc -5).
  • qc -h [or] qc --help - Show the help message.

Performance

qc is built to be faster than traditional wc -l loops by using byte-level scanning and avoiding unnecessary UTF-8 validation where possible.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with 🦀 by toast1599