kubernetes / apiextensions-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 1,843 units with 33,492 lines of code in units (88.1% of code).
    • 71 very long units (15,283 lines of code)
    • 29 long units (2,031 lines of code)
    • 173 medium size units (5,283 lines of code)
    • 335 small units (4,861 lines of code)
    • 1,235 very small units (6,034 lines of code)
45% | 6% | 15% | 14% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go45% | 6% | 15% | 14% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/apis58% | 3% | 10% | 10% | 16%
pkg/apiserver22% | 13% | 33% | 18% | 11%
pkg/controller0% | 23% | 33% | 31% | 11%
pkg/cmd0% | 39% | 19% | 27% | 13%
pkg/registry0% | 7% | 45% | 22% | 24%
pkg/client0% | 0% | 9% | 34% | 55%
pkg/apihelpers0% | 0% | 0% | 16% | 83%
pkg/crdserverscheme0% | 0% | 0% | 65% | 35%
ROOT0% | 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/apis/apiextensions/v1beta1/generated.pb.go
1671 479 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
1671 479 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
515 70 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
515 70 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
375 109 1
func()
in pkg/apiserver/customresource_handler.go
315 57 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
280 81 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
280 81 1
func()
in pkg/apis/apiextensions/deepcopy.go
243 57 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
241 67 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
241 67 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
236 68 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
228 64 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
228 64 1
func()
in pkg/apis/apiextensions/v1beta1/deepcopy.go
225 53 1
func RegisterConversions()
in pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go
223 45 1
func RegisterConversions()
in pkg/apis/apiextensions/v1/zz_generated.conversion.go
223 45 1
func()
in pkg/apis/apiextensions/v1/deepcopy.go
211 50 1
func()
in pkg/apis/apiextensions/v1beta1/generated.pb.go
210 59 1
func()
in pkg/apis/apiextensions/v1/generated.pb.go
210 59 1