bottlerocket-os / bottlerocket-ecs-updater
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 20 units with 545 lines of code in units (49.5% of code).
    • 1 very long units (123 lines of code)
    • 1 long units (52 lines of code)
    • 7 medium size units (236 lines of code)
    • 7 small units (104 lines of code)
    • 4 very small units (30 lines of code)
22% | 9% | 43% | 19% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go22% | 9% | 43% | 19% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
updater22% | 9% | 43% | 19% | 5%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func _main()
in updater/main.go
123 26 0
func()
in updater/aws.go
52 11 1
func()
in updater/aws.go
45 6 1
func()
in updater/aws.go
43 10 1
func()
in updater/aws.go
35 6 1
func()
in updater/aws.go
32 6 1
func()
in updater/aws.go
30 6 1
func()
in updater/aws.go
29 6 1
func()
in updater/aws.go
22 3 1
func()
in updater/aws.go
19 4 1
func()
in updater/aws.go
16 2 1
func()
in updater/aws.go
15 3 1
func taskDefFamily()
in updater/main.go
15 3 0
func eachPage()
in updater/aws.go
14 4 4
func()
in updater/aws.go
14 3 1
func parseCommandOutput()
in updater/aws.go
11 4 1
func()
in updater/aws.go
10 2 1
func containsAttribute()
in updater/aws.go
8 3 2
func()
in updater/aws.go
6 1 1
func main()
in updater/main.go
6 2 0