kubernetes / gengo
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 141 units with 1,785 lines of code in units (79.6% of code).
    • 1 very long units (143 lines of code)
    • 4 long units (295 lines of code)
    • 17 medium size units (500 lines of code)
    • 28 small units (409 lines of code)
    • 91 very small units (438 lines of code)
8% | 16% | 28% | 22% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go8% | 16% | 28% | 22% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
parser22% | 9% | 30% | 22% | 14%
namer0% | 39% | 23% | 12% | 25%
generator0% | 18% | 34% | 18% | 28%
types0% | 0% | 15% | 41% | 42%
args0% | 0% | 22% | 48% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in parser/parse.go
143 31 1
func()
in generator/execute.go
84 21 1
func()
in namer/namer.go
78 18 1
func()
in namer/namer.go
74 22 1
func()
in parser/parse.go
59 17 1
func()
in namer/plural_namer.go
41 12 1
func()
in parser/parse.go
39 10 1
func()
in parser/parse.go
39 12 1
func transitiveClosure()
in generator/transitive_closure.go
35 12 1
func FlattenMembers()
in types/flatten.go
33 10 1
func()
in generator/execute.go
33 10 1
func()
in parser/parse.go
33 10 1
func()
in parser/parse.go
33 6 1
func()
in namer/import_tracker.go
27 8 1
func()
in parser/parse.go
27 8 1
func assembleGolangFile()
in generator/execute.go
26 6 2
func()
in generator/execute.go
24 5 1
func()
in args/args.go
23 5 1
func NewContext()
in generator/generator.go
23 4 3
func New()
in parser/parse.go
22 3 0