kubernetes / cli-runtime
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 297 units with 3,821 lines of code in units (77.3% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (487 lines of code)
    • 41 medium size units (1,307 lines of code)
    • 62 small units (956 lines of code)
    • 186 very small units (1,071 lines of code)
0% | 12% | 34% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 12% | 34% | 25% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/printers0% | 23% | 47% | 10% | 17%
pkg/resource0% | 8% | 35% | 31% | 24%
pkg/genericclioptions0% | 12% | 21% | 23% | 42%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func decorateTable()
in pkg/printers/tableprinter.go
80 25 2
func()
in pkg/resource/builder.go
71 14 1
func()
in pkg/genericclioptions/config_flags.go
63 20 1
func()
in pkg/genericclioptions/config_flags.go
59 20 1
func printTable()
in pkg/printers/tableprinter.go
57 17 3
func()
in pkg/printers/tableprinter.go
54 19 1
func()
in pkg/resource/visitor.go
52 15 1
func()
in pkg/resource/builder.go
51 10 1
func()
in pkg/resource/builder.go
46 11 1
func()
in pkg/genericclioptions/builder_flags.go
46 12 1
func addColumns()
in pkg/printers/tableprinter.go
45 12 4
func exists()
in pkg/printers/jsonpath.go
44 12 2
func()
in pkg/genericclioptions/jsonpath_flags.go
44 15 1
func()
in pkg/printers/yaml.go
43 12 1
func()
in pkg/resource/builder.go
41 13 1
func()
in pkg/genericclioptions/template_flags.go
41 15 1
func()
in pkg/resource/builder.go
40 10 1
func()
in pkg/resource/builder.go
40 12 1
func()
in pkg/printers/json.go
40 10 1
func printRows()
in pkg/printers/tableprinter.go
37 15 4