firecracker-microvm / firecracker-go-sdk
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 1,048 units with 7,498 lines of code in units (73.1% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (299 lines of code)
    • 67 medium size units (1,663 lines of code)
    • 96 small units (1,343 lines of code)
    • 880 very small units (4,193 lines of code)
0% | 3% | 22% | 17% | 55%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 3% | 22% | 17% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 15% | 20% | 26% | 37%
client/operations0% | 0% | 27% | 8% | 63%
cni/internal0% | 0% | 33% | 38% | 27%
cni/vmconf0% | 0% | 80% | 19% | 0%
client/models0% | 0% | 2% | 31% | 66%
fctesting0% | 0% | 0% | 19% | 80%
client0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in network.go
67 13 1
func()
in machine.go
65 9 1
64 13 1
func()
in network.go
52 8 1
func jail()
in jailer.go
51 9 3
func NewMachine()
in machine.go
48 11 3
func()
in network.go
38 15 1
func()
in machine.go
37 14 1
func StaticNetworkConfFrom()
in cni/vmconf/vmconf.go
37 6 2
func()
in cni/internal/netlink.go
36 7 1
func()
in network.go
35 7 1
func()
in machine.go
32 7 1
func()
in machine.go
29 6 1
func()
in cni/vmconf/vmconf.go
29 1 1
func VMTapPair()
in cni/internal/cniutil.go
29 5 2
func()
in machine.go
26 5 1
func()
in machine.go
26 5 1
func()
in client/operations/patch_balloon_stats_interval_responses.go
25 7 1
func()
in client/operations/load_snapshot_responses.go
25 7 1
func()
in client/operations/put_guest_boot_source_responses.go
25 7 1