firebase / boringSSL-SwiftPM
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,482 units with 140,994 lines of code in units (29.4% of code).
    • 177 very long units (52,431 lines of code)
    • 352 long units (23,995 lines of code)
    • 1,054 medium size units (33,250 lines of code)
    • 1,146 small units (16,977 lines of code)
    • 2,753 very small units (14,341 lines of code)
37% | 17% | 23% | 12% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
pl65% | 13% | 11% | 5% | 3%
go58% | 11% | 17% | 7% | 4%
h92% | 0% | 1% | <1% | 5%
c14% | 22% | 31% | 17% | 14%
cc18% | 20% | 32% | 16% | 12%
py0% | 16% | 33% | 18% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src37% | 17% | 23% | 12% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static const alignas()
in src/crypto/fipsmodule/ec/p256-x86_64-table.h
9473 1 1
func()
in src/util/fipstools/delocate/delocate.peg.go
6001 757 1
sub $acc0, $acc2()
in src/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl
1501 10 0
func()
in src/util/fipstools/acvp/acvptool/parser.peg.go
1036 134 1
sub $tp,sp,$num,lsl()
in src/crypto/fipsmodule/bn/asm/armv8-mont.pl
898 10 0
sub $out,$out,()
in src/crypto/chacha/asm/chacha-armv8.pl
754 7 0
sub \$6,$len()
in src/crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl
744 4 0
static bool GetConfig()
in src/util/fipstools/acvp/modulewrapper/modulewrapper.cc
630 1 2
sub \$$FrameSize, %rsp()
in src/crypto/fipsmodule/bn/asm/rsaz-avx2.pl
609 2 0
sub %r10,%r11()
in src/crypto/fipsmodule/bn/asm/x86_64-mont.pl
591 2 0
sub \$1,$j()
in src/crypto/fipsmodule/bn/asm/x86_64-mont5.pl
562 6 0
&sub()
in src/crypto/chacha/asm/chacha-x86.pl
512 21 0
sub \$64,%rsp()
in src/crypto/fipsmodule/bn/asm/rsaz-avx2.pl
511 2 0
int boringssl_fips_self_test()
in src/crypto/fipsmodule/self_check/self_check.c
503 58 2
sub \$1,%rax()
in src/crypto/fipsmodule/aes/asm/vpaes-x86_64.pl
494 1 0
sub $rptr,%r11()
in src/crypto/fipsmodule/bn/asm/x86_64-mont5.pl
478 1 0
static void sc_muladd()
in src/crypto/curve25519/curve25519.c
456 1 4
sub $rptr,%r11()
in src/crypto/fipsmodule/bn/asm/x86_64-mont5.pl
419 1 0
sub \$16*6,$len()
in src/crypto/fipsmodule/aes/asm/aesni-x86_64.pl
395 3 0
sub \$16*6,$len()
in src/crypto/fipsmodule/aes/asm/aesni-x86_64.pl
374 3 0