tokei vs scc

tokei vs scc: compare their workflows, configuration choices, and practical tradeoffs.

Updated

short verdict

Use tokei for counts and reusable results. Choose scc when complexity estimates, unique lines, or HTML reporting belong in the same run.

Define the metric before choosing a code counter. Line counts describe repository size; complexity and cost estimates add assumptions that need separate interpretation.

this page is for

  • line counts and reusable counting results
  • line counts with complexity and cost estimates
pick

tokei

★ 15.1kRust
details

Use tokei for language-by-language line counts, ignore-file filtering, and a Rust library interface.

best for

  • line counts and reusable counting results

strengths

  • Respects .gitignore and .ignore with .tokeignore and --exclude options
  • Use --files for per-file counts and --input to combine earlier results
  • Export JSON, YAML, or CBOR and sort by code, comments, or blanks

weaknesses

  • Ignore rules affect the measured scope; keep them consistent before comparing repository counts.
pick

scc

★ 8.9kGo
details

Use scc when line counts need accompanying complexity estimates, unique-line counts, or an HTML report.

best for

  • line counts with complexity and cost estimates

strengths

  • Compute complexity estimates and unique lines of code
  • Skip duplicate, minified, or large files with explicit filters
  • Use --report for HTML and .sccconfig for shared settings

weaknesses

  • COCOMO cost figures depend on model assumptions; they are estimates rather than a project budget.

Key differences

  • Metrics: tokei reports code, comment, blank, and file counts; scc adds complexity estimates and unique-line counts.
  • Output: tokei supports JSON, YAML, and CBOR; scc supports formats including CSV, JSON, SQL, and HTML.
  • Filtering: tokei uses ignore files and --exclude; scc offers duplicate, minified-file, and large-file filters.
  • Reuse: tokei offers --input and a Rust library interface; scc offers shared .sccconfig settings and an HTML report.

Choose tokei when

  • Respects .gitignore and .ignore with .tokeignore and --exclude options
  • Use --files for per-file counts and --input to combine earlier results
  • Export JSON, YAML, or CBOR and sort by code, comments, or blanks

Choose scc when

  • Compute complexity estimates and unique lines of code
  • Skip duplicate, minified, or large files with explicit filters
  • Use --report for HTML and .sccconfig for shared settings

FAQ

How do I keep repeated repository measurements comparable?
Use the same revision, input paths, and exclusions. tokei honors ignore files, while scc offers filters for duplicate, minified, and large files; record those choices alongside the result.
Can I reuse previous tokei results?
The --input option combines results from earlier runs. tokei also exposes a Rust library when you want counting inside a program rather than only through a shell command.
What does an scc cost estimate mean?
Its COCOMO calculation is a model-based estimate, with assumptions adjustable through flags such as --avg-wage and --cocomo-project-type. Use --no-cocomo when you only want the other metrics.

related