kubernetes / repo-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 57 units with 1,181 lines of code in units (38.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 10 medium complex units (566 lines of code)
    • 7 simple units (214 lines of code)
    • 40 very simple units (401 lines of code)
0% | 0% | 47% | 18% | 33%
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% | 51% | 17% | 31%
py0% | 0% | 31% | 23% | 44%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools/build_tar0% | 0% | 67% | 5% | 26%
cmd/kazel0% | 0% | 38% | 28% | 33%
hack0% | 0% | 41% | 6% | 52%
defs0% | 0% | 0% | 80% | 20%
defs/testgen0% | 0% | 0% | 0% | 100%
defs/testpkg0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func newFileMeta()
in tools/build_tar/buildtar.go
99 21 7
def file_passes()
in hack/verify_boilerplate.py
42 20 3
func()
in tools/build_tar/buildtar.go
59 17 1
func main()
in tools/build_tar/buildtar.go
86 16 0
func ReconcileRules()
in cmd/kazel/kazel.go
54 15 4
func()
in tools/build_tar/buildtar.go
67 15 1
func()
in cmd/kazel/generator.go
45 14 1
func()
in cmd/kazel/sourcerer.go
55 12 1
func main()
in cmd/kazel/kazel.go
38 12 0
def get_files()
in hack/verify_boilerplate.py
21 11 1
def main()
in defs/gcs_uploader.py
36 9 1
func asExpr()
in cmd/kazel/kazel.go
34 9 1
func()
in cmd/kazel/generator.go
38 8 1
func writeFile()
in cmd/kazel/kazel.go
34 8 5
func newVendorer()
in cmd/kazel/kazel.go
36 7 3
func()
in tools/build_tar/buildtar.go
26 7 1
def normalize_files()
in hack/verify_boilerplate.py
10 6 1
func Diff()
in cmd/kazel/diff.go
29 5 2
func()
in cmd/kazel/kazel.go
18 5 1
func newTarFile()
in tools/build_tar/buildtar.go
38 5 4