@@ -219,69 +219,74 @@ features listed below may be missing from your installation.
219
219
220
220
```
221
221
Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation.
222
- Version 3.4.0
222
+ Version 3.5.0 (beta)
223
223
Ben Boyter <[email protected] > + Contributors
224
224
225
225
Usage:
226
226
scc [flags] [files or directories]
227
227
228
228
Flags:
229
- --avg-wage int average wage value used for basic COCOMO calculation (default 56286)
230
- --binary disable binary file detection
231
- --by-file display output for every file
232
- -m, --character calculate max and mean characters per line
233
- --ci enable CI output settings where stdout is ASCII
234
- --cocomo-project-type string change COCOMO model type [organic, semi-detached, embedded, "custom,1,1,1,1"] (default "organic")
235
- --count-as string count extension as language [e.g. jsp:htm,chead:"C Header" maps extension jsp to html and chead to C Header]
236
- --count-ignore set to allow .gitignore and .ignore files to be counted
237
- --currency-symbol string set currency symbol (default "$")
238
- --debug enable debug output
239
- -a, --dryness calculate the DRYness of the project (implies --uloc)
240
- --eaf float the effort adjustment factor derived from the cost drivers (1.0 if rated nominal) (default 1)
241
- --exclude-dir strings directories to exclude (default [.git,.hg,.svn])
242
- -x, --exclude-ext strings ignore file extensions (overrides include-ext) [comma separated list: e.g. go,java,js]
243
- -n, --exclude-file strings ignore files with matching names (default [package-lock.json,Cargo.lock,yarn.lock,pubspec.lock,Podfile.lock,pnpm-lock.yaml])
244
- --file-gc-count int number of files to parse before turning the GC on (default 10000)
245
- -f, --format string set output format [tabular, wide, json, json2, csv, csv-stream, cloc-yaml, html, html-table, sql, sql-insert, openmetrics] (default "tabular")
246
- --format-multi string have multiple format output overriding --format [e.g. tabular:stdout,csv:file.csv,json:file.json]
247
- --gen identify generated files
248
- --generated-markers strings string markers in head of generated files (default [do not edit,<auto-generated />])
249
- -h, --help help for scc
250
- -i, --include-ext strings limit to file extensions [comma separated list: e.g. go,java,js]
251
- --include-symlinks if set will count symlink files
252
- -l, --languages print supported languages and extensions
253
- --large-byte-count int number of bytes a file can contain before being removed from output (default 1000000)
254
- --large-line-count int number of lines a file can contain before being removed from output (default 40000)
255
- --min identify minified files
256
- -z, --min-gen identify minified or generated files
257
- --min-gen-line-length int number of bytes per average line for file to be considered minified or generated (default 255)
258
- --no-cocomo remove COCOMO calculation output
259
- -c, --no-complexity skip calculation of code complexity
260
- -d, --no-duplicates remove duplicate files from stats and output
261
- --no-gen ignore generated files in output (implies --gen)
262
- --no-gitignore disables .gitignore file logic
263
- --no-gitmodule disables .gitmodules file logic
264
- --no-hborder remove horizontal borders between sections
265
- --no-ignore disables .ignore file logic
266
- --no-large ignore files over certain byte and line size set by max-line-count and max-byte-count
267
- --no-min ignore minified files in output (implies --min)
268
- --no-min-gen ignore minified or generated files in output (implies --min-gen)
269
- --no-size remove size calculation output
270
- -M, --not-match stringArray ignore files and directories matching regular expression
271
- -o, --output string output filename (default stdout)
272
- --overhead float set the overhead multiplier for corporate overhead (facilities, equipment, accounting, etc.) (default 2.4)
273
- -p, --percent include percentage values in output
274
- --remap-all string inspect every file and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
275
- --remap-unknown string inspect files of unknown type and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
276
- --size-unit string set size unit [si, binary, mixed, xkcd-kb, xkcd-kelly, xkcd-imaginary, xkcd-intel, xkcd-drive, xkcd-bakers] (default "si")
277
- --sloccount-format print a more SLOCCount like COCOMO calculation
278
- -s, --sort string column to sort by [files, name, lines, blanks, code, comments, complexity] (default "files")
279
- --sql-project string use supplied name as the project identifier for the current run. Only valid with the --format sql or sql-insert option
280
- -t, --trace enable trace output (not recommended when processing multiple files)
281
- -u, --uloc calculate the number of unique lines of code (ULOC) for the project
282
- -v, --verbose verbose output
283
- --version version for scc
284
- -w, --wide wider output with additional statistics (implies --complexity)
229
+ --avg-wage int average wage value used for basic COCOMO calculation (default 56286)
230
+ --binary disable binary file detection
231
+ --by-file display output for every file
232
+ -m, --character calculate max and mean characters per line
233
+ --ci enable CI output settings where stdout is ASCII
234
+ --cocomo-project-type string change COCOMO model type [organic, semi-detached, embedded, "custom,1,1,1,1"] (default "organic")
235
+ --count-as string count extension as language [e.g. jsp:htm,chead:"C Header" maps extension jsp to html and chead to C Header]
236
+ --count-ignore set to allow .gitignore and .ignore files to be counted
237
+ --currency-symbol string set currency symbol (default "$")
238
+ --debug enable debug output
239
+ --directory-walker-job-workers int controls the maximum number of workers which will walk the directory tree (default 8)
240
+ -a, --dryness calculate the DRYness of the project (implies --uloc)
241
+ --eaf float the effort adjustment factor derived from the cost drivers (1.0 if rated nominal) (default 1)
242
+ --exclude-dir strings directories to exclude (default [.git,.hg,.svn])
243
+ -x, --exclude-ext strings ignore file extensions (overrides include-ext) [comma separated list: e.g. go,java,js]
244
+ -n, --exclude-file strings ignore files with matching names (default [package-lock.json,Cargo.lock,yarn.lock,pubspec.lock,Podfile.lock,pnpm-lock.yaml])
245
+ --file-gc-count int number of files to parse before turning the GC on (default 10000)
246
+ --file-list-queue-size int the size of the queue of files found and ready to be read into memory (default 8)
247
+ --file-process-job-workers int number of goroutine workers that process files collecting stats (default 8)
248
+ --file-summary-job-queue-size int the size of the queue used to hold processed file statistics before formatting (default 8)
249
+ -f, --format string set output format [tabular, wide, json, json2, csv, csv-stream, cloc-yaml, html, html-table, sql, sql-insert, openmetrics] (default "tabular")
250
+ --format-multi string have multiple format output overriding --format [e.g. tabular:stdout,csv:file.csv,json:file.json]
251
+ --gen identify generated files
252
+ --generated-markers strings string markers in head of generated files (default [do not edit,<auto-generated />])
253
+ -h, --help help for scc
254
+ -i, --include-ext strings limit to file extensions [comma separated list: e.g. go,java,js]
255
+ --include-symlinks if set will count symlink files
256
+ -l, --languages print supported languages and extensions
257
+ --large-byte-count int number of bytes a file can contain before being removed from output (default 1000000)
258
+ --large-line-count int number of lines a file can contain before being removed from output (default 40000)
259
+ --min identify minified files
260
+ -z, --min-gen identify minified or generated files
261
+ --min-gen-line-length int number of bytes per average line for file to be considered minified or generated (default 255)
262
+ --no-cocomo remove COCOMO calculation output
263
+ -c, --no-complexity skip calculation of code complexity
264
+ -d, --no-duplicates remove duplicate files from stats and output
265
+ --no-gen ignore generated files in output (implies --gen)
266
+ --no-gitignore disables .gitignore file logic
267
+ --no-gitmodule disables .gitmodules file logic
268
+ --no-hborder remove horizontal borders between sections
269
+ --no-ignore disables .ignore file logic
270
+ --no-large ignore files over certain byte and line size set by max-line-count and max-byte-count
271
+ --no-min ignore minified files in output (implies --min)
272
+ --no-min-gen ignore minified or generated files in output (implies --min-gen)
273
+ --no-scc-ignore disables .sccignore file logic
274
+ --no-size remove size calculation output
275
+ -M, --not-match stringArray ignore files and directories matching regular expression
276
+ -o, --output string output filename (default stdout)
277
+ --overhead float set the overhead multiplier for corporate overhead (facilities, equipment, accounting, etc.) (default 2.4)
278
+ -p, --percent include percentage values in output
279
+ --remap-all string inspect every file and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
280
+ --remap-unknown string inspect files of unknown type and remap by checking for a string and remapping the language [e.g. "-*- C++ -*-":"C Header"]
281
+ --size-unit string set size unit [si, binary, mixed, xkcd-kb, xkcd-kelly, xkcd-imaginary, xkcd-intel, xkcd-drive, xkcd-bakers] (default "si")
282
+ --sloccount-format print a more SLOCCount like COCOMO calculation
283
+ -s, --sort string column to sort by [files, name, lines, blanks, code, comments, complexity] (default "files")
284
+ --sql-project string use supplied name as the project identifier for the current run. Only valid with the --format sql or sql-insert option
285
+ -t, --trace enable trace output (not recommended when processing multiple files)
286
+ -u, --uloc calculate the number of unique lines of code (ULOC) for the project
287
+ -v, --verbose verbose output
288
+ --version version for scc
289
+ -w, --wide wider output with additional statistics (implies --complexity)
285
290
```
286
291
287
292
Output should look something like the below for the redis project
@@ -343,6 +348,8 @@ https://paste.c-net.org/Example
343
348
344
349
` scc ` mostly supports .ignore files inside directories that it scans. This is similar to how ripgrep, ag and tokei work. .ignore files are 100% the same as .gitignore files with the same syntax, and as such ` scc ` will ignore files and directories listed in them. You can add .ignore files to ignore things like vendored dependency checked in files and such. The idea is allowing you to add a file or folder to git and have ignored in the count.
345
350
351
+ It also supports its own ignore file ` .sccignore ` if you want ` scc ` to ignore things while having ripgrep, ag, tokei and others support them.
352
+
346
353
### Interesting Use Cases
347
354
348
355
Used inside Intel Nemu Hypervisor to track code changes between revisions https://github.com/intel/nemu/blob/topic/virt-x86/tools/cloc-change.sh#L9
0 commit comments