loccount#
loccount
是一个代码统计工具,可以统计一个目录下的代码行数,作者是大名鼎鼎的老牌黑客 ESR
编译安装#
% git clone https://gitlab.com/esr/loccount
% cd loccount
% go mod init loccount
% make
% ./loccount -h
Usage of ./loccount:
-J Dump trait table as JSON.
-V report version and exit
-c report Cocomo-model estimation
-cpuprofile string
write cpu profile to file
-d int
set debug level
-e list extensions associated with each language and exit
-g list generated files
-i list counts and types for individual files
-j dump statistics in JSON format
-l list languages that yield LLOC and exit
-n do not tally documentation
-s list languages that yield SLOC and exit
-t Dump transitions in output.
-u list unclassified files
-x string
paths and directories to exclude (regexp)
示例#
% loccount ~/Code/loccount
all SLOC=4321 (100.00%) LLOC=1213 in 111 files
Go SLOC=1724 (39.90%) LLOC=835 in 3 files
asciidoc SLOC=761 (17.61%) LLOC=0 in 5 files
C SLOC=278 (6.43%) LLOC=8 in 2 files
Python SLOC=179 (4.14%) LLOC=0 in 2 files
JavaScript SLOC=112 (2.59%) LLOC=0 in 1 files
Prolog SLOC=91 (2.11%) LLOC=22 in 2 files
Rebol SLOC=74 (1.71%) LLOC=0 in 1 files
waf SLOC=65 (1.50%) LLOC=0 in 1 files
Yorick SLOC=62 (1.43%) LLOC=42 in 1 files
makefile SLOC=45 (1.04%) LLOC=0 in 1 files
Python3 SLOC=42 (0.97%) LLOC=0 in 2 files
BCPL SLOC=40 (0.93%) LLOC=0 in 1 files
Algol60 SLOC=39 (0.90%) LLOC=19 in 1 files
asm SLOC=36 (0.83%) LLOC=0 in 2 files
Lex SLOC=34 (0.79%) LLOC=19 in 1 files
Rust SLOC=32 (0.74%) LLOC=11 in 1 files
Dylan SLOC=32 (0.74%) LLOC=23 in 1 files
Mint SLOC=30 (0.69%) LLOC=0 in 1 files
SETL SLOC=30 (0.69%) LLOC=23 in 1 files
Rexx SLOC=26 (0.60%) LLOC=0 in 1 files
TLA+ SLOC=26 (0.60%) LLOC=0 in 1 files
COBOL SLOC=25 (0.58%) LLOC=0 in 1 files
Tcl SLOC=24 (0.56%) LLOC=0 in 2 files
BLISS SLOC=21 (0.49%) LLOC=0 in 1 files
SNOBOL4 SLOC=21 (0.49%) LLOC=0 in 1 files
B SLOC=20 (0.46%) LLOC=12 in 1 files
Perl SLOC=20 (0.46%) LLOC=15 in 3 files
SQL SLOC=20 (0.46%) LLOC=0 in 1 files
D SLOC=18 (0.42%) LLOC=10 in 1 files
Expect SLOC=16 (0.37%) LLOC=0 in 1 files
PHP SLOC=15 (0.35%) LLOC=4 in 2 files
Turing SLOC=15 (0.35%) LLOC=0 in 1 files
Factor SLOC=14 (0.32%) LLOC=0 in 1 files
Stan SLOC=13 (0.30%) LLOC=0 in 1 files
Julia SLOC=13 (0.30%) LLOC=0 in 2 files
Ruby SLOC=13 (0.30%) LLOC=0 in 3 files
csh SLOC=13 (0.30%) LLOC=0 in 2 files
Eiffel SLOC=12 (0.28%) LLOC=0 in 1 files
Oberon SLOC=12 (0.28%) LLOC=9 in 1 files
MATLAB SLOC=11 (0.25%) LLOC=0 in 1 files
CLU SLOC=11 (0.25%) LLOC=0 in 1 files
Metafont SLOC=10 (0.23%) LLOC=9 in 1 files
POP-11 SLOC=10 (0.23%) LLOC=0 in 1 files
awk SLOC=10 (0.23%) LLOC=0 in 2 files
ChucK SLOC=10 (0.23%) LLOC=7 in 1 files
Elvish SLOC=9 (0.21%) LLOC=0 in 1 files
Pkl SLOC=9 (0.21%) LLOC=0 in 1 files
Haskell SLOC=8 (0.19%) LLOC=0 in 1 files
VHDL SLOC=8 (0.19%) LLOC=0 in 1 files
ML SLOC=8 (0.19%) LLOC=0 in 1 files
Pascal SLOC=8 (0.19%) LLOC=3 in 2 files
Zephir SLOC=8 (0.19%) LLOC=2 in 1 files
Fortran90 SLOC=6 (0.14%) LLOC=0 in 1 files
Simula SLOC=6 (0.14%) LLOC=4 in 1 files
Fortran SLOC=6 (0.14%) LLOC=0 in 1 files
Objective-C SLOC=6 (0.14%) LLOC=2 in 1 files
PL/1 SLOC=6 (0.14%) LLOC=6 in 1 files
Vala SLOC=6 (0.14%) LLOC=2 in 1 files
Modula2 SLOC=6 (0.14%) LLOC=4 in 1 files
MUMPS SLOC=6 (0.14%) LLOC=0 in 2 files
Sather SLOC=5 (0.12%) LLOC=3 in 1 files
Ada SLOC=5 (0.12%) LLOC=4 in 1 files
Icon SLOC=5 (0.12%) LLOC=0 in 1 files
ProtocolBuffers SLOC=5 (0.12%) LLOC=3 in 1 files
Seed7 SLOC=5 (0.12%) LLOC=3 in 1 files
C# SLOC=5 (0.12%) LLOC=1 in 1 files
cmake SLOC=5 (0.12%) LLOC=0 in 1 files
occam SLOC=5 (0.12%) LLOC=0 in 1 files
Haxe SLOC=5 (0.12%) LLOC=1 in 1 files
Lisp SLOC=5 (0.12%) LLOC=0 in 3 files
Modula3 SLOC=5 (0.12%) LLOC=2 in 1 files
Verilog SLOC=4 (0.09%) LLOC=2 in 1 files
Kotlin SLOC=4 (0.09%) LLOC=0 in 1 files
VRML SLOC=4 (0.09%) LLOC=0 in 1 files
Erlang SLOC=4 (0.09%) LLOC=0 in 1 files
Cobra SLOC=3 (0.07%) LLOC=0 in 1 files
Dart SLOC=3 (0.07%) LLOC=1 in 1 files
ABC SLOC=2 (0.05%) LLOC=0 in 1 files
shell SLOC=2 (0.05%) LLOC=0 in 2 files
F# SLOC=2 (0.05%) LLOC=0 in 1 files
Modula SLOC=2 (0.05%) LLOC=0 in 1 files
BASIC SLOC=2 (0.05%) LLOC=2 in 1 files
J SLOC=1 (0.02%) LLOC=0 in 1 files
HTML SLOC=1 (0.02%) LLOC=0 in 1 files
Groovy SLOC=1 (0.02%) LLOC=0 in 1 files