aws-samples / amazon-eks-observability-demo
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 21 units with 353 lines of code in units (21.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 1 simple units (56 lines of code)
    • 20 very simple units (297 lines of code)
0% | 0% | 0% | 15% | 84%
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
ts0% | 0% | 0% | 21% | 78%
go0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
base/lib0% | 0% | 0% | 70% | 29%
observability/lib0% | 0% | 0% | 0% | 100%
utils0% | 0% | 0% | 0% | 100%
apps/simple-frontend0% | 0% | 0% | 0% | 100%
apps/simple-frontend-otel0% | 0% | 0% | 0% | 100%
apps/simple-backend0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in base/lib/base-stack.ts
56 6 3
func main()
in apps/simple-frontend/main.go
30 4 0
export function loadManifest()
in utils/manifest-utils.ts
18 4 1
export function importCluster()
in utils/cluster-utils.ts
16 4 2
func initTracer()
in apps/simple-frontend-otel/main.go
19 2 0
func main()
in apps/simple-backend/main.go
16 2 0
constructor()
in observability/lib/container-insights-stack.ts
16 1 3
constructor()
in observability/lib/cluster-logging-stack.ts
18 1 3
constructor()
in observability/lib/cloudwatch-namespace.ts
19 1 3
constructor()
in observability/lib/opentelemetry-stack.ts
32 1 3
constructor()
in observability/lib/prometheus-cloudwatch-stack.ts
15 1 3
constructor()
in observability/lib/xray-stack.ts
14 1 3
func main()
in apps/simple-frontend-otel/main.go
7 1 0
func handler()
in apps/simple-frontend-otel/main.go
4 1 2
func init()
in apps/simple-frontend/main.go
7 1 0
func init()
in apps/simple-backend/main.go
7 1 0
func random()
in apps/simple-backend/main.go
6 1 1
export function applyManifest()
in utils/manifest-utils.ts
4 1 2
export function prepareNamespace()
in utils/manifest-utils.ts
16 1 3
10 1 5