kubernetes / kube-aggregator
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 689 units with 8,260 lines of code in units (78.6% of code).
    • 12 very long units (2,012 lines of code)
    • 11 long units (734 lines of code)
    • 44 medium size units (1,347 lines of code)
    • 117 small units (1,651 lines of code)
    • 505 very small units (2,516 lines of code)
24% | 8% | 16% | 19% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go24% | 8% | 16% | 19% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/apis37% | 11% | 10% | 14% | 25%
pkg/controllers12% | 12% | 25% | 25% | 24%
pkg/apiserver20% | 8% | 38% | 15% | 16%
pkg/client0% | 0% | 9% | 34% | 55%
pkg/cmd0% | 0% | 68% | 13% | 18%
pkg/registry0% | 0% | 19% | 25% | 54%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
241 70 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
241 70 1
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
210 59 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
210 59 1
func()
in pkg/controllers/status/available_controller.go
185 35 1
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
148 43 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
148 43 1
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
133 37 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
133 37 1
func()
in pkg/apiserver/apiserver.go
131 21 1
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
116 33 1
func()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
83 23 1
func()
in pkg/apis/apiregistration/v1/generated.pb.go
83 23 1
func skipGenerated()
in pkg/apis/apiregistration/v1beta1/generated.pb.go
78 24 1
func skipGenerated()
in pkg/apis/apiregistration/v1/generated.pb.go
78 24 1
func NewAvailableConditionController()
in pkg/controllers/status/available_controller.go
64 6 8
func RegisterConversions()
in pkg/apis/apiregistration/v1beta1/zz_generated.conversion.go
63 13 1
func RegisterConversions()
in pkg/apis/apiregistration/v1/zz_generated.conversion.go
63 13 1
func()
in pkg/controllers/openapiv3/aggregator/downloader.go
61 13 1