kubernetes / controller-manager
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 97 units with 911 lines of code in units (69.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (212 lines of code)
    • 17 small units (276 lines of code)
    • 72 very small units (423 lines of code)
0% | 0% | 23% | 30% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 23% | 30% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
config/v1alpha10% | 0% | 36% | 17% | 46%
pkg/clientbuilder0% | 0% | 33% | 22% | 43%
pkg/leadermigration0% | 0% | 19% | 58% | 21%
config/v1beta10% | 0% | 22% | 0% | 77%
app0% | 0% | 31% | 68% | 0%
options0% | 0% | 0% | 58% | 41%
config0% | 0% | 0% | 23% | 76%
pkg/healthz0% | 0% | 0% | 0% | 100%
pkg/informerfactory0% | 0% | 0% | 0% | 100%
pkg/features0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/clientbuilder/client_builder_dynamic.go
41 6 1
func RegisterConversions()
in config/v1alpha1/zz_generated.conversion.go
33 7 1
func()
in pkg/leadermigration/options/options.go
27 8 1
func()
in pkg/clientbuilder/client_builder_dynamic.go
24 3 1
func RegisterConversions()
in config/v1beta1/zz_generated.conversion.go
23 5 1
func WaitForAPIServer()
in app/helper.go
22 4 2
21 5 3
21 5 3
20 6 1
func()
in options/generic.go
19 4 1
func NewLeaderMigrator()
in pkg/leadermigration/migrator.go
19 5 2
func getOrCreateServiceAccount()
in pkg/clientbuilder/client_builder_dynamic.go
19 7 3
func()
in options/generic.go
18 2 1
func()
in options/generic.go
18 5 1
func DefaultLeaderMigrationConfiguration()
in pkg/leadermigration/config/default.go
18 1 0
18 6 3
func ValidateLeaderMigrationConfiguration()
in pkg/leadermigration/config/config.go
16 5 1
16 3 3
func ReadLeaderMigrationConfiguration()
in pkg/leadermigration/config/config.go
15 4 1
func()
in config/v1alpha1/zz_generated.deepcopy.go
15 2 1