kubernetes / pod-security-admission
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 247 units with 2,969 lines of code in units (74.3% of code).
    • 0 very long units (0 lines of code)
    • 11 long units (664 lines of code)
    • 20 medium size units (636 lines of code)
    • 57 small units (851 lines of code)
    • 159 very small units (818 lines of code)
0% | 22% | 21% | 28% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 22% | 21% | 28% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
policy0% | 28% | 25% | 36% | 9%
admission0% | 50% | 20% | 11% | 17%
cmd/webhook/server0% | 26% | 27% | 34% | 12%
admission/api0% | 0% | 36% | 15% | 47%
api0% | 0% | 18% | 28% | 52%
admission/api/v1alpha10% | 0% | 16% | 19% | 64%
admission/api/v1beta10% | 0% | 16% | 19% | 64%
metrics0% | 0% | 11% | 28% | 59%
admission/api/validation0% | 0% | 0% | 81% | 18%
admission/api/load0% | 0% | 0% | 50% | 50%
admission/api/scheme0% | 0% | 0% | 0% | 100%
cmd/webhook0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func restrictedVolumes_1_0()
in policy/check_restrictedVolumes.go
80 25 2
func seLinuxOptions_1_0()
in policy/check_seLinuxOptions.go
73 15 2
func()
in cmd/webhook/server/server.go
64 10 1
func()
in admission/admission.go
62 11 1
func seccompProfileRestricted_1_19()
in policy/check_seccompProfile_restricted.go
60 11 2
func()
in admission/admission.go
56 17 1
func()
in admission/admission.go
56 12 1
func capabilitiesRestricted_1_22()
in policy/check_capabilities_restricted.go
55 12 2
func()
in admission/admission.go
54 15 1
func runAsNonRoot_1_0()
in policy/check_runAsNonRoot.go
53 11 2
func()
in admission/admission.go
51 12 1
func ToPolicy()
in admission/api/helpers.go
44 7 1
func seccompProfileBaseline_1_19()
in policy/check_seccompProfile_baseline.go
41 9 2
func PolicyToEvaluate()
in api/helpers.go
41 10 2
func windowsHostProcess_1_0()
in policy/check_windowsHostProcess.go
40 12 2
func Setup()
in cmd/webhook/server/server.go
38 7 1
func isSignificantPodUpdate()
in admission/admission.go
37 13 2
func RegisterConversions()
in admission/api/v1alpha1/zz_generated.conversion.go
33 7 1
func RegisterConversions()
in admission/api/v1beta1/zz_generated.conversion.go
33 7 1
func validateChecks()
in policy/registry.go
32 11 1