kubernetes / ingress-nginx
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 734 units with 13,470 lines of code in units (49.3% of code).
    • 3 very complex units (944 lines of code)
    • 4 complex units (731 lines of code)
    • 55 medium complex units (2,990 lines of code)
    • 97 simple units (2,801 lines of code)
    • 575 very simple units (6,004 lines of code)
7% | 5% | 22% | 20% | 44%
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
go7% | 5% | 22% | 20% | 43%
lua0% | 0% | 10% | 31% | 57%
py0% | 0% | 44% | 28% | 27%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
internal/ingress10% | 5% | 24% | 23% | 36%
cmd/nginx0% | 52% | 17% | 16% | 13%
cmd/plugin0% | 0% | 14% | 5% | 79%
internal/net0% | 0% | 21% | 13% | 64%
rootfs/etc0% | 0% | 10% | 31% | 57%
images/custom-error-pages0% | 0% | 78% | 0% | 21%
images/kube-webhook-certgen0% | 0% | 14% | 14% | 70%
internal/nginx0% | 0% | 21% | 19% | 58%
hack/boilerplate0% | 0% | 44% | 28% | 27%
internal/watch0% | 0% | 78% | 0% | 21%
internal/sets0% | 0% | 78% | 0% | 22%
internal/k8s0% | 0% | 0% | 44% | 55%
internal/task0% | 0% | 0% | 30% | 69%
cmd/dbg0% | 0% | 0% | 15% | 84%
internal/admission0% | 0% | 0% | 0% | 100%
internal/runtime0% | 0% | 0% | 0% | 100%
internal/file0% | 0% | 0% | 0% | 100%
images/fastcgi-helloserver0% | 0% | 0% | 0% | 100%
cmd/waitshutdown0% | 0% | 0% | 0% | 100%
version0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func New()
in internal/ingress/controller/store/store.go
461 76 11
func ReadConfig()
in internal/ingress/controller/template/configmap.go
261 56 1
func()
in internal/ingress/controller/controller.go
222 54 1
func parseFlags()
in cmd/nginx/flags.go
260 44 0
func()
in internal/ingress/types_equals.go
120 42 1
func()
in internal/ingress/controller/controller.go
207 40 1
func()
in internal/ingress/controller/nginx.go
144 28 1
func()
in internal/ingress/controller/controller.go
87 24 1
func()
in internal/ingress/controller/controller.go
112 24 1
func()
in internal/ingress/controller/controller.go
118 24 1
func()
in internal/ingress/controller/store/backend_ssl.go
89 23 1
func()
in internal/ingress/types_equals.go
62 22 1
func cleanConf()
in internal/ingress/controller/template/template.go
72 22 2
func()
in internal/ingress/annotations/proxy/main.go
60 21 1
func mergeAlternativeBackends()
in internal/ingress/controller/controller.go
76 21 3
func getEndpoints()
in internal/ingress/controller/endpoints.go
72 21 4
func getIngressInformation()
in internal/ingress/controller/template/template.go
72 21 3
func main()
in cmd/nginx/main.go
84 19 0
func()
in internal/ingress/annotations/authreq/main.go
80 19 1
func()
in internal/ingress/types_equals.go
48 18 1