awslabs / aws-lc
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 5,594 units with 144,576 lines of code in units (28.4% of code).
    • 184 very long units (53,493 lines of code)
    • 369 long units (25,083 lines of code)
    • 1,081 medium size units (34,197 lines of code)
    • 1,171 small units (17,324 lines of code)
    • 2,789 very small units (14,479 lines of code)
36% | 17% | 23% | 11% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
pl64% | 14% | 12% | 5% | 3%
go58% | 12% | 17% | 7% | 4%
h92% | 0% | 1% | <1% | 6%
c14% | 22% | 31% | 16% | 14%
cc18% | 20% | 32% | 16% | 12%
py0% | 21% | 25% | 23% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
crypto38% | 17% | 22% | 11% | 10%
util56% | 12% | 18% | 7% | 4%
ssl15% | 20% | 32% | 17% | 14%
tool26% | 25% | 31% | 10% | 5%
decrepit22% | 43% | 18% | 6% | 7%
fuzz0% | 0% | 57% | 26% | 16%
include0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static const alignas()
in crypto/fipsmodule/ec/p256-nistz-table.h
9473 1 1
func()
in util/fipstools/delocate/delocate.peg.go
6113 771 1
sub $acc0, $acc2()
in crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl
1501 10 0
func()
in util/fipstools/acvp/acvptool/parser.peg.go
1036 134 1
sub $tp,sp,$num,lsl()
in crypto/fipsmodule/bn/asm/armv8-mont.pl
898 10 0
sub $out,$out,()
in crypto/chacha/asm/chacha-armv8.pl
754 7 0
sub \$6,$len()
in crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl
744 4 0
static bool GetConfig()
in util/fipstools/acvp/modulewrapper/modulewrapper.cc
632 1 2
sub \$$FrameSize, %rsp()
in crypto/fipsmodule/bn/asm/rsaz-avx2.pl
609 2 0
sub %r10,%r11()
in crypto/fipsmodule/bn/asm/x86_64-mont.pl
591 2 0
sub \$1,$j()
in crypto/fipsmodule/bn/asm/x86_64-mont5.pl
562 6 0
int boringssl_fips_self_test()
in crypto/fipsmodule/self_check/self_check.c
540 56 1
&sub()
in crypto/chacha/asm/chacha-x86.pl
512 21 0
sub \$64,%rsp()
in crypto/fipsmodule/bn/asm/rsaz-avx2.pl
511 2 0
sub \$1,%rax()
in crypto/fipsmodule/aes/asm/vpaes-x86_64.pl
494 1 0
sub $rptr,%r11()
in crypto/fipsmodule/bn/asm/x86_64-mont5.pl
478 1 0
static void sc_muladd()
in crypto/curve25519/curve25519.c
456 1 4
sub $rptr,%r11()
in crypto/fipsmodule/bn/asm/x86_64-mont5.pl
419 1 0
sub \$16*6,$len()
in crypto/fipsmodule/aes/asm/aesni-x86_64.pl
395 3 0
sub \$16*6,$len()
in crypto/fipsmodule/aes/asm/aesni-x86_64.pl
374 3 0