firecracker-microvm / firecracker-containerd
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 836 units with 7,994 lines of code in units (80.0% of code).
    • 4 very long units (573 lines of code)
    • 19 long units (1,447 lines of code)
    • 59 medium size units (1,820 lines of code)
    • 112 small units (1,582 lines of code)
    • 642 very small units (2,572 lines of code)
7% | 18% | 22% | 19% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go7% | 18% | 22% | 19% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
proto/service29% | 24% | 11% | 15% | 19%
internal/cmd75% | 0% | 0% | 15% | 9%
runtime0% | 22% | 42% | 20% | 14%
agent0% | 36% | 16% | 37% | 10%
firecracker-control0% | 33% | 10% | 42% | 13%
internal/debug0% | 45% | 0% | 29% | 25%
internal/vm0% | 8% | 34% | 29% | 27%
internal0% | 0% | 60% | 24% | 15%
eventbridge0% | 0% | 57% | 16% | 25%
config0% | 0% | 100% | 0% | 0%
proto0% | 0% | 1% | 1% | 97%
firecracker-control/client0% | 0% | 0% | 83% | 16%
internal/bundle0% | 0% | 0% | 25% | 75%
runtime/firecrackeroci0% | 0% | 0% | 60% | 39%
runtime/cpuset0% | 0% | 0% | 0% | 100%
firecracker-control/cmd0% | 0% | 0% | 0% | 100%
internal/shim0% | 0% | 0% | 0% | 100%
client0% | 0% | 0% | 0% | 100%
internal/event0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in proto/service/drivemount/ttrpc/drivemount.pb.go
181 49 1
func()
in proto/service/ioproxy/ttrpc/ioproxy.pb.go
174 49 1
func()
in proto/service/ioproxy/ttrpc/ioproxy.pb.go
117 31 1
func add()
in internal/cmd/test-bridged-tap/main.go
101 17 1
func()
in runtime/service.go
93 22 1
func()
in agent/service.go
92 16 1
func RegisterFirecrackerService()
in proto/service/fccontrol/ttrpc/fccontrol.pb.go
88 13 2
func main()
in agent/main.go
88 18 0
func()
in firecracker-control/local.go
88 18 1
func()
in proto/service/drivemount/ttrpc/drivemount.pb.go
85 22 1
func()
in runtime/service.go
84 18 1
func()
in internal/debug/debug.go
83 36 1
func()
in runtime/service.go
79 12 1
func skipDrivemount()
in proto/service/drivemount/ttrpc/drivemount.pb.go
78 24 1
func skipIoproxy()
in proto/service/ioproxy/ttrpc/ioproxy.pb.go
78 24 1
func()
in agent/service.go
77 11 1
func()
in proto/service/ioproxy/ttrpc/ioproxy.pb.go
73 19 1
func()
in firecracker-control/local.go
73 12 1
func()
in runtime/runc_jailer.go
66 13 1
func()
in internal/vm/ioproxy.go
60 10 1