scc

Fast source code line counter

TLDR

Count lines in current directory
$ scc
Count specific directory
$ scc [path/to/dir]
Count specific language
$ scc --include-ext [py]
Exclude directories
$ scc --exclude-dir [vendor,node_modules]
Sort by lines
$ scc --sort lines
Output as JSON
$ scc --format json
Show complexity estimates
$ scc -w
Show by file
$ scc --by-file

SYNOPSIS

scc [--include-ext ext] [--exclude-dir dirs] [--format fmt] [options] [paths]

DESCRIPTION

scc (Succinct Code Counter) counts lines of code in many languages. It's extremely fast, using parallelism and optimized parsing.Output shows files, lines, blanks, comments, and code per language. Wide mode adds complexity estimates based on branching.Language detection uses file extensions and content inspection. Hundreds of languages are recognized, from common to obscure.Generated and minified file detection prevents counting boilerplate. Duplicates can be ignored to avoid counting vendored code multiple times.COCOMO estimation provides rough effort metrics. These are theoretical but useful for comparisons.Output formats support integration with other tools. JSON and CSV enable processing by scripts and dashboards.

PARAMETERS

--include-ext EXT

Include only extensions.
--exclude-dir DIRS
Exclude directories.
--sort FIELD
Sort by field (files, lines, blanks, code, comments).
--format FMT
Output format (default, json, csv, html, etc.).
-w, --wide
Show complexity and weighted lines.
--by-file
Show per-file breakdown.
--no-duplicates
Ignore duplicate files.
--no-gen
Ignore generated files.
--no-min
Ignore minified files.
--cocomo
Show COCOMO estimates.
-f PATTERN
Match filenames.
-M SIZE
Max file size.

INSTALL

sudo pacman -S sc-controller
sudo apk add sc-controller
sudo zypper install sc-controller
brew install scc
nix profile install nixpkgs#sc-controller

CAVEATS

Complexity estimates are heuristic. Language detection may misidentify some files. Very large codebases may need memory.

HISTORY

scc was created by Ben Boyter around 2018 as a faster alternative to cloc and other line counters. Written in Go, it emphasizes speed through parallelism and efficient algorithms.

SEE ALSO

cloc(1), tokei(1), loc(1), wc(1)