home / dev-tools / scc

scc

8.2k

Code metrics CLI for counting files, lines, comments, complexity, ULOC, and estimated cost across source trees.

$go install github.com/boyter/scc/v3@latest
Language
Go
Stars
8,158
Category
Dev Tools
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

scc is a source code metrics CLI for scanning directories and summarizing language mix, line counts, complexity estimates, duplicate handling, and cost-style estimates across many programming languages.

What It Enables
  • Measure language mix, file counts, code/comment/blank lines, and processed bytes for a repository or set of directories.
  • Sort per-file results to find the largest or most complex files, and optionally account for duplicates, minified files, generated files, or oversized files before deeper review.
  • Export repo metrics as JSON, CSV, HTML, SQL, or OpenMetrics for CI jobs, dashboards, or follow-up scripts.
Agent Fit
  • JSON and JSON2 output, stable flags, and stdout or file-based reporting make it easy to drop into inspect-parse-report loops.
  • Ignore-file support, extension filters, per-file mode, and --format-multi work well for automated repo audits and CI reporting.
  • This is inspection-only, and its complexity and COCOMO outputs are heuristics, so agents should treat them as prioritization signals rather than authoritative code-quality judgments.
Caveats
  • The complexity metric is a fast file-level approximation based on token matching, not parsed AST analysis.
  • ULOC and DRYness calculations add extra work; the README warns they can significantly increase runtime on large trees.