OS Manuals

/usr/bin/scc

Fast and accurate code counter with complexity calculations and COCOMO estimates

From scc-fips 4.1.0-r5 (enterprise-packages), captured 2026-11-08 by running scc --help (exit 0). permalink

Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation.
Version 4.1.0
Ben Boyter <ben@boyter.org> + Contributors
https://github.com/boyter/scc

Usage:
  scc [flags] [files or directories]

Examples:
  Count the current directory:
    scc

  Count a specific folder or file:
    scc myproject/
    scc main.go

  Count several paths at once:
    scc src/ docs/ README.md

  Show a per-file breakdown instead of the per-language summary:
    scc --by-file

  Output as CSV or JSON (e.g. for further processing):
    scc --format csv
    scc --format json -o counts.json

  Count an unrecognised extension as a known language:
    scc --count-as jsp:html

  Count files matching a path pattern as a new category (glob by default):
    scc --count-as-pattern '*_spec.rb:Ruby Spec:Ruby'

  Generate a self-contained HTML infographic report:
    scc --report
    scc --report=out.html --report-title "myrepo" --report-skip cocomo

  Use a project config file (./.sccconfig) or a global one (precedence: global < project < CLI):
    export SCC_CONFIG_PATH=~/.sccconfig
    scc --config team.sccconfig

  Tune the COCOMO cost estimate, or turn it off (see https://en.wikipedia.org/wiki/COCOMO):
    scc --avg-wage 75000 --cocomo-project-type semi-detached
    scc --no-cocomo

Flags:
      --avg-wage int                        average wage value used for basic COCOMO calculation (default 56286)
      --binary                              disable binary file detection
      --buckets int                         time-bucket resolution for the git timeline reports (default 60)
      --by-author                           render the author rollup report (bus factor and last-toucher attribution over recent git history)
      --by-file                             display output for every file
  -m, --character                           calculate max and mean characters per line
      --ci                                  enable CI output settings where stdout is ASCII
      --cocomo-project-type string          change COCOMO model type [organic, semi-detached, embedded, "custom,1,1,1,1"] (default "organic")
      --cognitive                           calculate cognitive (nesting-weighted) complexity
      --config string                       load this file as the global config source; overrides SCC_CONFIG_PATH, honored even with --no-config
      --cost-comparison                     show both COCOMO and LOCOMO estimates side by side
      --count-as string                     count extension as language [e.g. jsp:htm,chead:"C Header" maps extension jsp to html and chead to C Header]
      --count-as-pattern stringArray        count files matching a path pattern as a new named category backed by a base language [repeatable; pattern is glob by default, prefix with re: for regex; e.g. *_spec.rb:"Ruby Spec":Ruby or re:\.test\.js$:"JavaScript Tests":JavaScript]
      --count-ignore                        set to allow .gitignore and .ignore files to be counted
      --count-unsupported                   count files with an unrecognised language under an "Unknown" category as plain text
      --coupling                            render the change-coupling report (file pairs that change together over recent git history)
      --coupling-for string                 blast-radius view: given a file path, show what tends to change with it over recent git history
      --coupling-weighted                   weight coupling by file complexity so pairs of complex files rank above generated/data-file churn (implies --coupling)
      --currency-symbol string              set currency symbol (default "$")
      --debug                               enable debug output
      --depth int                           commit window size for git history reports; 0 means entire history (large repos may be slow) (default 1000)
      --directory-walker-job-workers int    controls the maximum number of workers which will walk the directory tree (default 8)
  -a, --dryness                             calculate the DRYness of the project (implies --uloc)
      --eaf float                           the effort adjustment factor derived from the cost drivers (1.0 if rated nominal) (default 1)
      --exclude-dir strings                 directories to exclude (default [.git,.hg,.svn])
  -x, --exclude-ext strings                 ignore file extensions (overrides include-ext) [comma separated list: e.g. go,java,js]
  -n, --exclude-file strings                ignore files with matching names (default [package-lock.json,Cargo.lock,yarn.lock,pubspec.lock,Podfile.lock,pnpm-lock.yaml])
      --exp-per-language-counters           experimental, may change or be removed: count with the scanner written for the file's language where there is one, currently C, C Header and Java
      --file-gc-count int                   number of files to parse before turning the GC on (default 10000)
      --file-list-job-workers int           number of goroutine workers that turn a walked path into a job to be counted (default 64)
      --file-list-queue-size int            the size of the queue of files found and ready to be read into memory (default 64)
      --file-process-job-workers int        number of goroutine workers that process files collecting stats (default 64)
      --file-summary-job-queue-size int     the size of the queue used to hold processed file statistics before formatting (default 64)
      --find-root-config                    discover the project .sccconfig by walking up to the repository root instead of using ./.sccconfig
  -f, --format string                       set output format [tabular, wide, json, json2, csv, csv-stream, cloc-yaml, html, html-table, sql, sql-insert, openmetrics] (default "tabular")
      --format-multi string                 have multiple format output overriding --format [e.g. tabular:stdout,csv:file.csv,json:file.json]
      --gen                                 identify generated files
      --generated-markers strings           string markers in head of generated files (default [do not edit,<auto-generated />])
  -h, --help                                help for scc
      --hotspots                            render the hotspots report (files ranked by complexity × change frequency over recent git history)
      --ignore-file stringArray             path to an additional gitignore-format ignore file, applied from the scan root; repeat to add more, later files and any in-tree ignore files take precedence
  -i, --include-ext strings                 limit to file extensions [comma separated list: e.g. go,java,js]
      --include-symlinks                    if set will count symlink files
  -l, --languages                           print supported languages and extensions
      --large-byte-count int                number of bytes a file can contain before being removed from output (default 1000000)
      --large-line-count int                number of lines a file can contain before being removed from output (default 40000)
      --locomo                              enable LOCOMO (LLM Output COst MOdel) cost estimation
      --locomo-config string                LOCOMO power-user config "tokensPerLine,inputPerLine,complexityWeight,iterations,iterationWeight"
      --locomo-cycles float                 override estimated LLM iteration cycles (default: calculated from complexity)
      --locomo-input-price float            LOCOMO cost per 1M input tokens in dollars (overrides preset)
      --locomo-output-price float           LOCOMO cost per 1M output tokens in dollars (overrides preset)
      --locomo-preset string                LOCOMO model preset [large, medium, small, local] (default "medium")
      --locomo-review float                 human review minutes per line of code for LOCOMO estimate (default 0.01)
      --locomo-tps float                    LOCOMO output tokens per second (overrides preset)
      --mcp                                 start as an MCP (Model Context Protocol) server over stdio
      --min                                 identify minified files
  -z, --min-gen                             identify minified or generated files
      --min-gen-line-length int             number of bytes per average line for file to be considered minified or generated (default 255)
      --no-cocomo                           remove COCOMO calculation output
  -c, --no-complexity                       skip calculation of code complexity
      --no-config                           disable auto-discovery of the SCC_CONFIG_PATH global and the project ./.sccconfig config
  -d, --no-duplicates                       remove duplicate files from stats and output
      --no-fold-authors                     disable the name+email-domain identity folding fallback for git author reports (mailmap still applied)
      --no-gen                              ignore generated files in output (implies --gen)
      --no-gitignore                        disables .gitignore file logic
      --no-gitmodule                        disables .gitmodules file logic
      --no-hborder                          remove horizontal borders between sections
      --no-ignore                           disables .ignore file logic
      --no-large                            ignore files over certain byte and line size set by large-line-count and large-byte-count
      --no-min                              ignore minified files in output (implies --min)
      --no-min-gen                          ignore minified or generated files in output (implies --min-gen)
      --no-scc-ignore                       disables .sccignore file logic
      --no-size                             remove size calculation output
  -M, --not-match stringArray               ignore files and directories matching regular expression
  -o, --output string                       output filename (default stdout)
      --overhead float                      set the overhead multiplier for corporate overhead (facilities, equipment, accounting, etc.) (default 2.4)
  -p, --percent                             include percentage values in output
      --remap-all string                    inspect every file and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
      --remap-unknown string                inspect files of unknown type and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
      --report string[="scc-report.html"]   write a self-contained HTML report; bare flag writes scc-report.html and prompts before overwriting, --report=path/out.html overwrites silently
      --report-skip string                  comma-separated sections to omit (cocomo,locomo,hotspots,coupling,authors,timeline,files,uloc,linelength,card)
      --report-title string                 override the repo name shown in the report banner
      --size-unit string                    set size unit [si, binary, mixed, xkcd-kb, xkcd-kelly, xkcd-imaginary, xkcd-intel, xkcd-drive, xkcd-bakers] (default "si")
      --sloccount-format                    print a more SLOCCount like COCOMO calculation
  -s, --sort string                         column to sort by [files, name, lines, blanks, code, comments, complexity] (default "files")
      --sql-project string                  use supplied name as the project identifier for the current run. Only valid with the --format sql or sql-insert option
      --timeline                            render an over-time view of recent git history; with --by-author runs the author timeline, alone runs the languages timeline
  -t, --trace                               enable trace output (not recommended when processing multiple files)
  -u, --uloc                                calculate the number of unique lines of code (ULOC) for the project
  -v, --verbose                             verbose output
      --version                             version for scc
  -w, --wide                                wider output with additional statistics (implies --complexity)
Options (92)
OptionDescriptionSource
--avg-wage intaverage wage value used for basic COCOMO calculation (default 56286)help
--binarydisable binary file detectionhelp
--buckets inttime-bucket resolution for the git timeline reports (default 60)help
--by-authorrender the author rollup report (bus factor and last-toucher attribution over recent git history)help
--by-filedisplay output for every filehelp
-m, --charactercalculate max and mean characters per linehelp
--cienable CI output settings where stdout is ASCIIhelp
--cocomo-project-type stringchange COCOMO model type [organic, semi-detached, embedded, "custom,1,1,1,1"] (default "organic")help
--cognitivecalculate cognitive (nesting-weighted) complexityhelp
--config stringload this file as the global config source;help
--cost-comparisonshow both COCOMO and LOCOMO estimates side by sidehelp
--count-as stringcount extension as language [e.g. jsp:htm,chead:"C Header" maps extension jsp to html and chead to C Header]help
--count-as-pattern stringArraycount files matching a path pattern as a new named category backed by a base language [repeatable;help
--count-ignoreset to allow .gitignore and .ignore files to be countedhelp
--count-unsupportedcount files with an unrecognised language under an "Unknown" category as plain texthelp
--couplingrender the change-coupling report (file pairs that change together over recent git history)help
--coupling-for stringblast-radius view: given a file path, show what tends to change with it over recent git historyhelp
--coupling-weightedweight coupling by file complexity so pairs of complex files rank above generated/data-file churn (implies --coupling)help
--currency-symbol stringset currency symbol (default "$")help
--debugenable debug outputhelp
--depth intcommit window size for git history reports;help
--directory-walker-job-workers intcontrols the maximum number of workers which will walk the directory tree (default 8)help
-a, --drynesscalculate the DRYness of the project (implies --uloc)help
--eaf floatthe effort adjustment factor derived from the cost drivers (1.0 if rated nominal) (default 1)help
--exclude-dir stringsdirectories to exclude (default [.git,.hg,.svn])help
-x, --exclude-ext stringsignore file extensions (overrides include-ext) [comma separated list: e.g. go,java,js]help
-n, --exclude-file stringsignore files with matching names (default [package-lock.json,Cargo.lock,yarn.lock,pubspec.lock,Podfile.lock,pnpm-lock.yaml])help
--exp-per-language-countersexperimental, may change or be removed: count with the scanner written for the file's language where there is one, currently C, C Header and Javahelp
--file-gc-count intnumber of files to parse before turning the GC on (default 10000)help
--file-list-job-workers intnumber of goroutine workers that turn a walked path into a job to be counted (default 64)help
--file-list-queue-size intthe size of the queue of files found and ready to be read into memory (default 64)help
--file-process-job-workers intnumber of goroutine workers that process files collecting stats (default 64)help
--file-summary-job-queue-size intthe size of the queue used to hold processed file statistics before formatting (default 64)help
--find-root-configdiscover the project .sccconfig by walking up to the repository root instead of using ./.sccconfighelp
-f, --format stringset output format [tabular, wide, json, json2, csv, csv-stream, cloc-yaml, html, html-table, sql, sql-insert, openmetrics] (default "tabular")help
--format-multi stringhave multiple format output overriding --format [e.g. tabular:stdout,csv:file.csv,json:file.json]help
--genidentify generated fileshelp
--generated-markers stringsstring markers in head of generated files (default [do not edit,<auto-generated />])help
-h, --helphelp for scchelp
--hotspotsrender the hotspots report (files ranked by complexity × change frequency over recent git history)help
--ignore-file stringArraypath to an additional gitignore-format ignore file, applied from the scan root;help
-i, --include-ext stringslimit to file extensions [comma separated list: e.g. go,java,js]help
--include-symlinksif set will count symlink fileshelp
-l, --languagesprint supported languages and extensionshelp
--large-byte-count intnumber of bytes a file can contain before being removed from output (default 1000000)help
--large-line-count intnumber of lines a file can contain before being removed from output (default 40000)help
--locomoenable LOCOMO (LLM Output COst MOdel) cost estimationhelp
--locomo-config stringLOCOMO power-user config "tokensPerLine,inputPerLine,complexityWeight,iterations,iterationWeight"help
--locomo-cycles floatoverride estimated LLM iteration cycles (default: calculated from complexity)help
--locomo-input-price floatLOCOMO cost per 1M input tokens in dollars (overrides preset)help
--locomo-output-price floatLOCOMO cost per 1M output tokens in dollars (overrides preset)help
--locomo-preset stringLOCOMO model preset [large, medium, small, local] (default "medium")help
--locomo-review floathuman review minutes per line of code for LOCOMO estimate (default 0.01)help
--locomo-tps floatLOCOMO output tokens per second (overrides preset)help
--mcpstart as an MCP (Model Context Protocol) server over stdiohelp
--minidentify minified fileshelp
-z, --min-genidentify minified or generated fileshelp
--min-gen-line-length intnumber of bytes per average line for file to be considered minified or generated (default 255)help
--no-cocomoremove COCOMO calculation outputhelp
-c, --no-complexityskip calculation of code complexityhelp
--no-configdisable auto-discovery of the SCC_CONFIG_PATH global and the project ./.sccconfig confighelp
-d, --no-duplicatesremove duplicate files from stats and outputhelp
--no-fold-authorsdisable the name+email-domain identity folding fallback for git author reports (mailmap still applied)help
--no-genignore generated files in output (implies --gen)help
--no-gitignoredisables .gitignore file logichelp
--no-gitmoduledisables .gitmodules file logichelp
--no-hborderremove horizontal borders between sectionshelp
--no-ignoredisables .ignore file logichelp
--no-largeignore files over certain byte and line size set by large-line-count and large-byte-counthelp
--no-minignore minified files in output (implies --min)help
--no-min-genignore minified or generated files in output (implies --min-gen)help
--no-scc-ignoredisables .sccignore file logichelp
--no-sizeremove size calculation outputhelp
-M, --not-match stringArrayignore files and directories matching regular expressionhelp
-o, --output stringoutput filename (default stdout)help
--overhead floatset the overhead multiplier for corporate overhead (facilities, equipment, accounting, etc.) (default 2.4)help
-p, --percentinclude percentage values in outputhelp
--remap-all stringinspect every file and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]help
--remap-unknown stringinspect files of unknown type and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]help
--report string[="scc-report.html"write a self-contained HTML report;help
--report-skip stringcomma-separated sections to omit (cocomo,locomo,hotspots,coupling,authors,timeline,files,uloc,linelength,card)help
--report-title stringoverride the repo name shown in the report bannerhelp
--size-unit stringset size unit [si, binary, mixed, xkcd-kb, xkcd-kelly, xkcd-imaginary, xkcd-intel, xkcd-drive, xkcd-bakers] (default "si")help
--sloccount-formatprint a more SLOCCount like COCOMO calculationhelp
-s, --sort stringcolumn to sort by [files, name, lines, blanks, code, comments, complexity] (default "files")help
--sql-project stringuse supplied name as the project identifier for the current run.help
--timelinerender an over-time view of recent git history;help
-t, --traceenable trace output (not recommended when processing multiple files)help
-u, --uloccalculate the number of unique lines of code (ULOC) for the projecthelp
-v, --verboseverbose outputhelp
--versionversion for scchelp
-w, --widewider output with additional statistics (implies --complexity)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.