kubernetes / cri-api
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 4,265 units with 70,800 lines of code in units (92.1% of code).
    • 136 very long units (30,622 lines of code)
    • 136 long units (10,706 lines of code)
    • 226 medium size units (7,331 lines of code)
    • 638 small units (8,777 lines of code)
    • 3,129 very small units (13,364 lines of code)
43% | 15% | 10% | 12% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go43% | 15% | 10% | 12% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/apis/runtime/v1alpha243% | 15% | 10% | 12% | 18%
pkg/apis/runtime/v143% | 15% | 10% | 12% | 18%
pkg/apis/testing0% | 0% | 30% | 30% | 38%
pkg/errors0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
737 211 1
func()
in pkg/apis/runtime/v1/api.pb.go
737 211 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
664 190 1
func()
in pkg/apis/runtime/v1/api.pb.go
664 190 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
597 176 1
func()
in pkg/apis/runtime/v1/api.pb.go
597 176 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
545 155 1
func()
in pkg/apis/runtime/v1/api.pb.go
545 155 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
513 146 1
func()
in pkg/apis/runtime/v1/api.pb.go
513 146 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
509 144 1
func()
in pkg/apis/runtime/v1/api.pb.go
509 144 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
441 124 1
func()
in pkg/apis/runtime/v1/api.pb.go
441 124 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
413 123 1
func()
in pkg/apis/runtime/v1/api.pb.go
413 123 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
388 112 1
func()
in pkg/apis/runtime/v1/api.pb.go
388 112 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
371 103 1
func()
in pkg/apis/runtime/v1alpha2/api.pb.go
371 103 1