bottlerocket-os / hotdog
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 18 units with 432 lines of code in units (81.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 8 medium size units (285 lines of code)
    • 4 small units (52 lines of code)
    • 5 very small units (31 lines of code)
0% | 14% | 65% | 12% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 14% | 65% | 12% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/hotdog-hotpatch0% | 22% | 75% | 0% | 1%
cmd/hotdog-cc-hook0% | 0% | 50% | 36% | 13%
cmd/hotdog-poststart-hook0% | 0% | 84% | 0% | 15%
hook0% | 0% | 0% | 69% | 30%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
func commandDroppedPrivs()
in cmd/hotdog-hotpatch/main.go
64 15 5
func findJVMs()
in cmd/hotdog-hotpatch/main.go
47 10 0
func constrainHotdogCapabilities()
in cmd/hotdog-hotpatch/main.go
45 14 0
func reexeced_main()
in cmd/hotdog-cc-hook/main.go
40 12 0
func findEUID()
in cmd/hotdog-hotpatch/main.go
39 11 1
func runHotpatch()
in cmd/hotdog-hotpatch/main.go
32 7 1
func findVersion()
in cmd/hotdog-hotpatch/main.go
30 11 1
func _main()
in cmd/hotdog-poststart-hook/main.go
27 6 0
func _main()
in cmd/hotdog-hotpatch/main.go
25 6 0
func hook_main()
in cmd/hotdog-cc-hook/main.go
15 3 0
func cp()
in cmd/hotdog-cc-hook/main.go
14 3 2
func State()
in hook/state.go
12 3 0
func Config()
in hook/state.go
11 3 1
func Root()
in hook/state.go
10 4 2
func _main()
in cmd/hotdog-cc-hook/main.go
6 3 0
func main()
in cmd/hotdog-cc-hook/main.go
5 2 0
func main()
in cmd/hotdog-poststart-hook/main.go
5 2 0
func main()
in cmd/hotdog-hotpatch/main.go
5 2 0