kubernetes / code-generator
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 503 units with 7,605 lines of code in units (79.1% of code).
    • 6 very long units (1,004 lines of code)
    • 18 long units (1,206 lines of code)
    • 78 medium size units (2,308 lines of code)
    • 94 small units (1,434 lines of code)
    • 307 very small units (1,653 lines of code)
13% | 15% | 30% | 18% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go13% | 15% | 30% | 18% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/client-gen18% | 13% | 22% | 21% | 23%
cmd/conversion-gen24% | 12% | 40% | 7% | 15%
cmd/go-to-protobuf14% | 28% | 29% | 13% | 13%
cmd/informer-gen13% | 0% | 37% | 21% | 27%
cmd/applyconfiguration-gen0% | 12% | 36% | 26% | 23%
cmd/lister-gen0% | 31% | 20% | 15% | 32%
cmd/register-gen0% | 43% | 0% | 22% | 34%
cmd/prerelease-lifecycle-gen0% | 17% | 42% | 14% | 25%
pkg/util0% | 0% | 36% | 39% | 24%
cmd/deepcopy-gen0% | 0% | 53% | 0% | 46%
cmd/defaulter-gen0% | 0% | 53% | 0% | 46%
cmd/openapi-gen0% | 0% | 0% | 100% | 0%
cmd/set-gen0% | 0% | 0% | 100% | 0%
cmd/import-boss0% | 0% | 0% | 100% | 0%
pkg/namer0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in cmd/client-gen/generators/generator_for_type.go
238 54 1
func Run()
in cmd/go-to-protobuf/protobuf/cmd.go
221 56 1
func()
in cmd/client-gen/generators/fake/generator_fake_for_type.go
202 45 1
func()
in cmd/conversion-gen/generators/conversion.go
134 31 1
func Packages()
in cmd/conversion-gen/generators/conversion.go
106 22 2
func Packages()
in cmd/informer-gen/generators/packages.go
103 24 2
func()
in cmd/go-to-protobuf/protobuf/parser.go
85 38 1
func Packages()
in cmd/lister-gen/generators/lister.go
83 16 2
func membersToFields()
in cmd/go-to-protobuf/protobuf/generator.go
81 29 4
func parseClientExtensions()
in cmd/client-gen/generators/util/tags.go
76 24 1
func memberTypeToProtobufField()
in cmd/go-to-protobuf/protobuf/generator.go
72 22 3
func findReferenced()
in cmd/applyconfiguration-gen/generators/openapi.go
72 29 3
func Packages()
in cmd/register-gen/generators/packages.go
71 14 2
func updateStructTags()
in cmd/go-to-protobuf/protobuf/parser.go
68 18 3
func Packages()
in cmd/client-gen/generators/client_generator.go
68 17 2
func Packages()
in cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go
67 15 2
func()
in cmd/conversion-gen/generators/conversion.go
66 14 1
func()
in cmd/client-gen/generators/generator_for_group.go
64 8 1
func packageForGroup()
in cmd/client-gen/generators/client_generator.go
58 2 10
func protobufTagToField()
in cmd/go-to-protobuf/protobuf/generator.go
57 12 5