kubernetes / system-validators
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 48 units with 727 lines of code in units (70.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 12 medium size units (353 lines of code)
    • 12 small units (184 lines of code)
    • 23 very small units (126 lines of code)
0% | 8% | 48% | 25% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 8% | 48% | 25% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
validators0% | 10% | 49% | 20% | 19%
hack0% | 0% | 40% | 60% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in validators/kernel_validator.go
64 17 1
func()
in validators/kernel_validator.go
48 9 1
func verifyBoilerplate()
in hack/verify-boilerplate.go
38 10 1
func()
in validators/docker_validator.go
37 8 1
func toSemVer()
in validators/package_validator_linux.go
35 11 1
func()
in validators/cgroup_validator_linux.go
32 7 1
func()
in validators/package_validator_linux.go
31 6 1
func applyPackageSpecOverride()
in validators/package_validator_linux.go
23 7 3
func()
in validators/cgroup_validator_linux.go
23 6 1
func()
in validators/docker_validator.go
22 5 1
func()
in validators/cgroup_validator_linux.go
22 7 1
func toSemVerRange()
in validators/package_validator_linux.go
21 8 1
func ValidateSpec()
in validators/validators.go
21 3 2
func()
in validators/package_validator_linux.go
18 5 1
func getOSDistro()
in validators/package_validator_linux.go
18 5 0
func()
in validators/kernel_validator.go
18 7 1
func()
in validators/report.go
18 5 1
func()
in validators/kernel_validator.go
17 4 1
func main()
in hack/verify-boilerplate.go
17 5 0
func Validate()
in validators/validators.go
15 4 2