aws-samples / aws-cdk-project-template-for-devops
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 67 units with 711 lines of code in units (57.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (33 lines of code)
    • 2 simple units (53 lines of code)
    • 64 very simple units (625 lines of code)
0% | 0% | 4% | 7% | 87%
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% | 4% | 90%
py0% | 0% | 0% | 30% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/template/pattern0% | 0% | 11% | 0% | 88%
codes/sample-backend-fastapi/app0% | 0% | 0% | 30% | 69%
lib/template0% | 0% | 0% | 26% | 73%
lib/template/stack0% | 0% | 0% | 0% | 100%
infra/stack0% | 0% | 0% | 0% | 100%
lib/template/common0% | 0% | 0% | 0% | 100%
lib/template/construct0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private createLambda()
in lib/template/pattern/lambda-pattern.ts
33 11 4
def get_secret()
in codes/sample-backend-fastapi/app/main.py
27 8 1
private updateContextArgs()
in lib/template/app-context.ts
26 8 2
private findAppConfigFile()
in lib/template/app-context.ts
18 5 1
protected importVpc()
in lib/template/stack/vpc/vpc-base-stack.ts
16 5 1
private loadLayers()
in lib/template/pattern/lambda-pattern.ts
11 4 2
def read_item()
in codes/sample-backend-fastapi/app/main.py
12 3 0
public createDynamoDBMetric()
in lib/template/pattern/cloudwatch-pattern.ts
16 3 4
public createLambdaMetric()
in lib/template/pattern/cloudwatch-pattern.ts
15 3 3
private createRole()
in lib/template/pattern/lambda-pattern.ts
15 3 2
constructor()
in lib/template/app-context.ts
14 3 1
private loadTemplate()
in lib/template/stack/cfn/cfn-include-stack.ts
12 3 1
protected createVpc()
in lib/template/stack/vpc/vpc-base-stack.ts
14 3 4
def __init__()
in codes/sample-backend-fastapi/app/utility.py
8 2 2
def get_items_count()
in codes/sample-backend-fastapi/app/utility.py
9 2 1
def put_item()
in codes/sample-backend-fastapi/app/utility.py
8 2 2
def connect_database()
in codes/sample-backend-fastapi/app/main.py
12 2 4
public createIotMetric()
in lib/template/pattern/cloudwatch-pattern.ts
15 2 4
public createKinesisMetric()
in lib/template/pattern/cloudwatch-pattern.ts
13 2 3
public createEndpointInstanceMetrics()
in lib/template/pattern/cloudwatch-pattern.ts
18 2 4