kubernetes / sample-apiserver
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 152 units with 1,082 lines of code in units (68.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 5 medium size units (143 lines of code)
    • 18 small units (248 lines of code)
    • 128 very small units (628 lines of code)
0% | 5% | 13% | 22% | 58%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 5% | 13% | 22% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/apis/wardle0% | 8% | 5% | 21% | 64%
pkg/cmd/server0% | 0% | 56% | 31% | 11%
pkg/admission/plugin0% | 0% | 59% | 0% | 40%
pkg/apiserver0% | 0% | 47% | 52% | 0%
pkg/registry/wardle0% | 0% | 0% | 28% | 71%
pkg/admission/wardleinitializer0% | 0% | 0% | 0% | 100%
pkg/registry0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func RegisterConversions()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
63 13 1
func RegisterConversions()
in pkg/apis/wardle/v1beta1/zz_generated.conversion.go
43 9 1
func()
in pkg/admission/plugin/banflunder/admission.go
29 8 1
func()
in pkg/cmd/server/start.go
27 4 1
func NewCommandStartWardleServer()
in pkg/cmd/server/start.go
23 4 2
func()
in pkg/apiserver/apiserver.go
21 3 1
func NewREST()
in pkg/registry/wardle/fischer/etcd.go
18 2 2
func NewREST()
in pkg/registry/wardle/flunder/etcd.go
18 2 2
func ValidateFlunderSpec()
in pkg/apis/wardle/validation/validation.go
18 14 2
func()
in pkg/cmd/server/start.go
16 3 1
func autoConvert_v1alpha1_FlunderList_To_wardle_FlunderList()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
15 4 3
func autoConvert_wardle_FlunderList_To_v1alpha1_FlunderList()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
15 4 3
func Convert_v1alpha1_FlunderSpec_To_wardle_FlunderSpec()
in pkg/apis/wardle/v1alpha1/conversion.go
13 4 3
func Convert_wardle_FlunderSpec_To_v1alpha1_FlunderSpec()
in pkg/apis/wardle/v1alpha1/conversion.go
13 3 3
func()
in pkg/apis/wardle/v1alpha1/zz_generated.deepcopy.go
13 3 1
func()
in pkg/apis/wardle/v1alpha1/zz_generated.deepcopy.go
13 3 1
func()
in pkg/apis/wardle/v1beta1/zz_generated.deepcopy.go
13 3 1
func()
in pkg/apis/wardle/zz_generated.deepcopy.go
13 3 1
func()
in pkg/apis/wardle/zz_generated.deepcopy.go
13 3 1
func NewWardleServerOptions()
in pkg/cmd/server/start.go
12 1 2