kubernetes / component-helpers
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 136 units with 1,304 lines of code in units (79.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (227 lines of code)
    • 15 simple units (304 lines of code)
    • 116 very simple units (773 lines of code)
0% | 0% | 17% | 23% | 59%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go0% | 0% | 17% | 23% | 59%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
auth/rbac/reconciliation0% | 0% | 32% | 7% | 59%
scheduling/corev1/nodeaffinity0% | 0% | 17% | 30% | 52%
auth/rbac/validation0% | 0% | 0% | 64% | 35%
node/util0% | 0% | 0% | 50% | 49%
apimachinery/lease0% | 0% | 0% | 28% | 71%
node/topology0% | 0% | 0% | 100% | 0%
apps/poddisruptionbudget0% | 0% | 0% | 39% | 60%
scheduling/corev10% | 0% | 0% | 0% | 100%
node/util/sysctl0% | 0% | 0% | 0% | 100%
storage/volume0% | 0% | 0% | 0% | 100%
storage/ephemeral0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func computeReconciledRole()
in auth/rbac/reconciliation/reconcile_role.go
44 18 3
func()
in auth/rbac/reconciliation/reconcile_rolebindings.go
62 17 1
func()
in auth/rbac/reconciliation/reconcile_role.go
57 15 1
func nodeSelectorRequirementsAsSelector()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
38 11 2
func aggregationRuleCovers()
in auth/rbac/reconciliation/reconcile_role.go
26 11 2
func computeReconciledRoleBinding()
in auth/rbac/reconciliation/reconcile_rolebindings.go
28 9 3
func ruleCovers()
in auth/rbac/validation/policy_comparator.go
13 9 2
func nodeSelectorRequirementsAsFieldSelector()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
30 8 2
func BreakdownRule()
in auth/rbac/validation/policy_comparator.go
22 8 1
27 8 3
func()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
12 7 1
func diffSubjectLists()
in auth/rbac/reconciliation/reconcile_rolebindings.go
17 7 2
func resourceCoversAll()
in auth/rbac/validation/policy_comparator.go
19 7 2
func NewPreferredSchedulingTerms()
in scheduling/corev1/nodeaffinity/nodeaffinity.go
24 6 2
func Covers()
in auth/rbac/validation/policy_comparator.go
20 6 2
func()
in apimachinery/lease/controller.go
16 6 1
func()
in apimachinery/lease/controller.go
19 6 1
26 6 2
func GetZoneKey()
in node/topology/helpers.go
18 6 1
func ConditionsAreUpToDate()
in apps/poddisruptionbudget/helpers.go
13 6 1