kubernetes / dns
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 200 units with 2,902 lines of code in units (80.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (319 lines of code)
    • 26 simple units (825 lines of code)
    • 168 very simple units (1,758 lines of code)
0% | 0% | 10% | 28% | 60%
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% | 11% | 28% | 60%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/dns0% | 0% | 10% | 35% | 53%
cmd/sidecar-e2e0% | 0% | 22% | 9% | 67%
pkg/dnsmasq0% | 0% | 27% | 52% | 20%
cmd/sidecar0% | 0% | 47% | 0% | 52%
cmd/node-cache0% | 0% | 0% | 55% | 44%
cmd/kube-dns0% | 0% | 0% | 13% | 86%
pkg/sidecar0% | 0% | 0% | 0% | 100%
pkg/version0% | 0% | 0% | 0% | 100%
pkg/netif0% | 0% | 0% | 0% | 100%
cmd/dnsmasq-nanny0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
pkg/util0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in cmd/sidecar-e2e/main.go
85 21 1
func()
in pkg/dnsmasq/nanny.go
55 15 1
func()
in pkg/dns/treecache/treecache.go
48 15 1
func()
in pkg/dns/dns.go
46 14 1
func()
in pkg/dns/dns.go
39 14 1
func()
in cmd/sidecar/main.go
46 13 1
func parseAndValidateFlags()
in cmd/node-cache/main.go
53 10 0
func()
in pkg/dns/config/sync_dir.go
43 10 1
func()
in cmd/node-cache/app/cache_app.go
32 9 1
func()
in pkg/dns/dns.go
38 9 1
func()
in pkg/dns/dns.go
40 9 1
func()
in pkg/dns/config/config.go
22 9 1
func()
in pkg/dns/config/sync.go
40 9 1
func()
in cmd/sidecar-e2e/main.go
36 8 1
func()
in cmd/node-cache/app/configmap.go
42 8 1
func()
in cmd/node-cache/app/cache_app.go
29 8 1
func()
in pkg/dnsmasq/nanny.go
40 8 1
func()
in pkg/dns/dns.go
27 8 1
func()
in pkg/dns/dns.go
36 8 1
func()
in cmd/node-cache/app/cache_app.go
23 7 1