kubernetes / test-infra
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 5,167 units with 85,762 lines of code in units (27.5% of code).
    • 6 very complex units (1,257 lines of code)
    • 40 complex units (4,869 lines of code)
    • 354 medium complex units (18,805 lines of code)
    • 755 simple units (21,371 lines of code)
    • 4,012 very simple units (39,460 lines of code)
1% | 5% | 21% | 24% | 46%
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
go1% | 6% | 22% | 23% | 45%
ts6% | 2% | 10% | 28% | 51%
py0% | 3% | 21% | 32% | 43%
js0% | 3% | 13% | 30% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
prow1% | 6% | 22% | 23% | 46%
kubetest6% | 10% | 20% | 25% | 36%
config0% | 14% | 13% | 45% | 26%
triage0% | 6% | 24% | 29% | 38%
testgrid0% | 17% | 30% | 11% | 40%
scenarios0% | 6% | 20% | 20% | 51%
experiment0% | 0% | 17% | 30% | 52%
robots0% | 0% | 29% | 28% | 42%
gubernator0% | 0% | 19% | 36% | 44%
jenkins0% | 0% | 37% | 28% | 34%
label_sync0% | 0% | 39% | 31% | 28%
pkg0% | 0% | 33% | 16% | 49%
kettle0% | 0% | 18% | 29% | 51%
ghproxy0% | 0% | 17% | 18% | 63%
gopherage0% | 0% | 7% | 24% | 68%
releng0% | 0% | 16% | 42% | 41%
maintenance0% | 0% | 33% | 10% | 55%
linkcheck0% | 0% | 81% | 0% | 18%
greenhouse0% | 0% | 18% | 28% | 53%
hack0% | 0% | 29% | 19% | 50%
images0% | 0% | 18% | 37% | 43%
gcsweb0% | 0% | 0% | 46% | 53%
gencred0% | 0% | 0% | 38% | 61%
boskos0% | 0% | 0% | 73% | 26%
logexporter0% | 0% | 0% | 27% | 72%
metrics0% | 0% | 0% | 37% | 62%
def0% | 0% | 0% | 28% | 71%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func parseProwConfig()
in prow/config/config.go
230 77 1
func validate()
in prow/cmd/checkconfig/main.go
166 70 1
func handle()
in prow/plugins/bugzilla/bugzilla.go
187 69 6
func run()
in kubetest/e2e.go
241 64 2
function redraw()
in prow/cmd/deck/static/prow/prow.ts
252 62 2
func prepareGcp()
in kubetest/main.go
181 56 1
func()
in prow/plank/reconciler.go
173 45 1
func ResolveBugzillaOptions()
in prow/plugins/config.go
142 45 2
function closestMatchingQueries()
in prow/cmd/deck/static/pr/pr.ts
96 42 2
func handle()
in prow/plugins/project/project.go
159 42 4
func handleGenericComment()
in prow/plugins/trigger/generic-comment.go
118 42 3
func()
in testgrid/pkg/configurator/prow/prow.go
150 41 1
func newKops()
in kubetest/kops.go
154 40 3
func()
in prow/plugins/config.go
19 40 1
def build_test()
in config/jobs/kubernetes/kops/build_jobs.py
155 40 11
func requirementDiff()
in prow/tide/status.go
118 39 3
func newGKE()
in kubetest/gke.go
141 38 12
func()
in kubetest/extract_k8s.go
134 37 1
func()
in prow/cmd/sinker/main.go
143 37 1
func handle()
in prow/plugins/verify-owners/verify-owners.go
132 37 11