kubernetes / component-helpers
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 136 units with 1,304 lines of code in units (79.0% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (119 lines of code)
    • 10 medium size units (288 lines of code)
    • 30 small units (447 lines of code)
    • 94 very small units (450 lines of code)
0% | 9% | 22% | 34% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 9% | 22% | 34% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
auth/rbac/reconciliation0% | 20% | 16% | 7% | 55%
scheduling/corev1/nodeaffinity0% | 0% | 42% | 51% | 6%
node/util0% | 0% | 50% | 49% | 0%
apimachinery/lease0% | 0% | 18% | 70% | 10%
auth/rbac/validation0% | 0% | 19% | 68% | 12%
apps/poddisruptionbudget0% | 0% | 0% | 100% | 0%
node/topology0% | 0% | 0% | 100% | 0%
scheduling/corev10% | 0% | 0% | 23% | 76%
node/util/sysctl0% | 0% | 0% | 33% | 66%
storage/volume0% | 0% | 0% | 0% | 100%
storage/ephemeral0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in auth/rbac/reconciliation/reconcile_rolebindings.go
62 17 1
func()
in auth/rbac/reconciliation/reconcile_role.go
57 15 1
func computeReconciledRole()
in auth/rbac/reconciliation/reconcile_role.go
44 18 3
func nodeSelectorRequirementsAsSelector()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
38 11 2
func nodeSelectorRequirementsAsFieldSelector()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
30 8 2
func computeReconciledRoleBinding()
in auth/rbac/reconciliation/reconcile_rolebindings.go
28 9 3
27 8 3
func aggregationRuleCovers()
in auth/rbac/reconciliation/reconcile_role.go
26 11 2
26 6 2
func NewPreferredSchedulingTerms()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
24 6 2
func()
in apimachinery/lease/controller.go
23 3 1
func BreakdownRule()
in auth/rbac/validation/policy_comparator.go
22 8 1
func Covers()
in auth/rbac/validation/policy_comparator.go
20 6 2
func UpdateDisruptionAllowedCondition()
in apps/poddisruptionbudget/helpers.go
20 3 1
func()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
19 5 1
func newNodeSelectorTerm()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
19 5 2
func resourceCoversAll()
in auth/rbac/validation/policy_comparator.go
19 7 2
func()
in apimachinery/lease/controller.go
19 6 1
func()
in apimachinery/lease/controller.go
18 3 1
func GetZoneKey()
in node/topology/helpers.go
18 6 1