cdklabs / cdk-watchful
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 115 units with 1,136 lines of code in units (70.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (64 lines of code)
    • 1 simple units (26 lines of code)
    • 112 very simple units (1,046 lines of code)
0% | 0% | 5% | 2% | 92%
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% | 5% | 2% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 9% | 0% | 90%
example0% | 0% | 0% | 44% | 55%
src/monitoring/aws/sqs0% | 0% | 0% | 0% | 100%
src/monitoring/aws/ecs0% | 0% | 0% | 0% | 100%
src/monitoring/aws/api-gateway0% | 0% | 0% | 0% | 100%
src/monitoring/aws/redshift0% | 0% | 0% | 0% | 100%
src/monitoring/aws/rds0% | 0% | 0% | 0% | 100%
src/monitoring/aws/lambda0% | 0% | 0% | 0% | 100%
src/monitoring/aws/sns0% | 0% | 0% | 0% | 100%
src/monitoring/aws/state-machine0% | 0% | 0% | 0% | 100%
src/monitoring/aws/dynamodb0% | 0% | 0% | 0% | 100%
src/widget0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public visit()
in src/aspect.ts
30 22 1
constructor()
in src/watchful.ts
34 12 3
constructor()
in example/index.ts
26 7 3
constructor()
in src/api-gateway.ts
35 5 3
private static toMarkdown()
in src/widget/section.ts
12 4 1
constructor()
in src/dynamodb.ts
20 3 3
constructor()
in src/ecs.ts
84 3 3
public addAlarm()
in src/watchful.ts
9 3 1
private createCallGraphWidget()
in src/api-gateway.ts
16 3 2
protected metric()
in src/monitoring/aws/api-gateway/metrics.ts
15 2 4
constructor()
in src/lambda.ts
43 2 3
12 2 1
8 2 1
8 2 1
19 1 4
12 1 2
20 1 4
8 1 2
15 1 4
3 1 2