explaingit

boyter/scc

8,385GoAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A fast command-line tool that counts lines of code, blanks, and comments across a codebase by programming language, with complexity estimates and COCOMO cost projections.

Mindmap

mindmap
  root((scc))
    What it does
      Count code lines
      Blank and comment lines
      By language breakdown
    Analysis
      Cyclomatic complexity
      COCOMO estimates
      DRYness metric
    Output Formats
      Plain text table
      JSON and CSV
      cloc YAML
    Install
      Homebrew
      Scoop
      Binary download
    Audience
      Developers
      Engineering leads
      DevOps teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Count lines of code in your project broken down by programming language to understand codebase size and composition.

USE CASE 2

Generate a JSON or CSV code metrics report to include in a CI pipeline or project dashboard.

USE CASE 3

Estimate cyclomatic complexity scores across files to identify the most complicated parts of a codebase.

USE CASE 4

Get a COCOMO estimate predicting developer-hours a codebase represents, useful for project planning or handoffs.

Tech stack

Go

Getting it running

Difficulty · easy Time to first run · 5min
Free to use for any purpose including commercial use, you only need to keep the MIT license notice.

In plain English

scc, short for Sloc Cloc and Code, is a command-line tool that counts lines of code in a software project. Given a directory of source files, it scans every file and reports how many lines are actual code, how many are blank, and how many are comments, broken down by programming language. It supports a large number of languages and runs on Windows, Linux, and macOS. The tool is designed to be extremely fast. It is written in Go and takes advantage of multiple CPU cores, getting faster as more cores are available. Its author created it partly to outperform older alternatives like cloc and sloccount on speed while keeping the results just as accurate. It can be installed through several package managers including Homebrew on Mac, Scoop on Windows, snap on Linux, or by downloading a pre-built binary from the releases page. Beyond simple line counts, scc offers additional analysis. It can estimate code complexity using a measure similar to cyclomatic complexity, which gives a rough sense of how complicated the logic in a codebase is. It can calculate COCOMO estimates, which are a classic formula used in software engineering to predict how many people and how much time a project of a given size might require to build. It also offers a newer LOCOMO estimate intended to approximate costs when using AI-assisted development. A DRYness metric identifies how many lines are unique versus repeated across files. Output can be formatted in several ways, including plain text tables, JSON, CSV, and a format compatible with cloc's YAML output, which makes it a drop-in replacement for teams already using cloc in their scripts. It can also run as an MCP server, which is a protocol used by some AI tools to expose capabilities as callable services. The project is licensed under the MIT licence and is free for individual developers and companies. A commercial enterprise version with team dashboards and historical analysis features was being explored at the time of writing, with early access sign-up available. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Run scc on my project directory and output the results as JSON, then explain what the complexity score means for the highest-complexity files.
Prompt 2
How do I use scc to get a COCOMO cost estimate for a codebase and what assumptions does that formula make about team size and time?
Prompt 3
Set up scc in a GitHub Actions CI workflow to report lines of code per language as a comment on every pull request.
Prompt 4
Use scc to find the DRYness score of my codebase and list which files have the most duplicated lines.
Prompt 5
Configure scc to produce a cloc-compatible YAML report so I can drop it into scripts that already use cloc output.
Open on GitHub → Explain another repo

← boyter on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.