aws / ec2-macos-init
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 66 units with 1,365 lines of code in units (74.5% of code).
    • 1 very long units (107 lines of code)
    • 3 long units (268 lines of code)
    • 14 medium size units (461 lines of code)
    • 23 small units (334 lines of code)
    • 25 very small units (195 lines of code)
7% | 19% | 33% | 24% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go7% | 19% | 33% | 24% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT43% | 0% | 29% | 20% | 6%
lib/ec2macosinit0% | 23% | 34% | 25% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func run()
in run.go
107 22 1
func()
in lib/ec2macosinit/systemconfig.go
100 25 1
func()
in lib/ec2macosinit/sshkeys.go
92 30 1
func()
in lib/ec2macosinit/systemconfig.go
76 12 1
func getUIDandGID()
in lib/ec2macosinit/util.go
49 11 1
func()
in lib/ec2macosinit/usermanagement.go
39 10 1
func main()
in ec2-macos-init.go
39 9 0
func()
in lib/ec2macosinit/userdata.go
38 10 1
func executeCommand()
in lib/ec2macosinit/util.go
34 7 3
func clean()
in clean.go
34 8 1
func modifySysctl()
in lib/ec2macosinit/systemconfig.go
32 8 1
func()
in lib/ec2macosinit/instancehistory.go
31 6 1
func()
in lib/ec2macosinit/motd.go
31 7 1
func()
in lib/ec2macosinit/module.go
31 8 1
func()
in lib/ec2macosinit/module.go
30 13 1
func()
in lib/ec2macosinit/networkcheck.go
27 7 1
func()
in lib/ec2macosinit/imds.go
23 6 1
func()
in lib/ec2macosinit/imds.go
23 5 1
func()
in lib/ec2macosinit/instancehistory.go
19 6 1
func()
in lib/ec2macosinit/module.go
19 6 1