kubernetes / metrics
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 673 units with 9,075 lines of code in units (82.9% of code).
    • 19 very long units (3,224 lines of code)
    • 14 long units (902 lines of code)
    • 32 medium size units (896 lines of code)
    • 119 small units (1,721 lines of code)
    • 489 very small units (2,332 lines of code)
35% | 9% | 9% | 18% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go35% | 9% | 9% | 18% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/apis/metrics/v1alpha147% | 13% | 8% | 10% | 20%
pkg/apis/metrics/v1beta147% | 13% | 8% | 10% | 20%
pkg/apis/custom_metrics/v1beta242% | 10% | 7% | 17% | 23%
pkg/apis/custom_metrics/v1beta142% | 12% | 7% | 14% | 23%
pkg/apis/external_metrics/v1beta145% | 15% | 11% | 8% | 19%
pkg/client/custom_metrics0% | 0% | 44% | 37% | 17%
pkg/client/clientset/versioned0% | 0% | 8% | 47% | 43%
pkg/client/clientset/deprecated0% | 0% | 9% | 45% | 44%
pkg/client/custom_metrics/fake0% | 0% | 0% | 65% | 34%
pkg/apis/metrics0% | 0% | 0% | 45% | 54%
pkg/client/external_metrics0% | 0% | 0% | 66% | 33%
pkg/apis/external_metrics0% | 0% | 0% | 43% | 56%
pkg/apis/custom_metrics0% | 0% | 0% | 19% | 80%
pkg/client/external_metrics/fake0% | 0% | 0% | 73% | 26%
pkg/client/custom_metrics/scheme0% | 0% | 0% | 0% | 100%
pkg/apis/custom_metrics/install0% | 0% | 0% | 0% | 100%
pkg/apis/metrics/install0% | 0% | 0% | 0% | 100%
pkg/apis/external_metrics/install0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/apis/external_metrics/v1beta1/generated.pb.go
294 83 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
277 79 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
277 79 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
236 69 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
210 58 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
210 58 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
201 59 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
182 53 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
182 53 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
117 33 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1alpha1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
116 33 1
func()
in pkg/apis/external_metrics/v1beta1/generated.pb.go
116 33 1
func()
in pkg/apis/custom_metrics/v1beta1/generated.pb.go
113 31 1
func()
in pkg/apis/custom_metrics/v1beta2/generated.pb.go
113 31 1
func skipGenerated()
in pkg/apis/metrics/v1alpha1/generated.pb.go
78 24 1