aws-samples / aws-ecs-devops-using-aws-cdk
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 85 units with 1,103 lines of code in units (71.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)
    • 1 simple units (26 lines of code)
    • 83 very simple units (1,044 lines of code)
0% | 0% | 2% | 2% | 94%
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% | 3% | 2% | 94%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/template/pattern0% | 0% | 11% | 0% | 88%
lib/template0% | 0% | 0% | 26% | 73%
infra/ecs-service/construct0% | 0% | 0% | 0% | 100%
infra/ecs-service0% | 0% | 0% | 0% | 100%
lib/template/stack0% | 0% | 0% | 0% | 100%
infra/common-infra0% | 0% | 0% | 0% | 100%
lib/template/common0% | 0% | 0% | 0% | 100%
codes/sample-backend-fastapi/app0% | 0% | 0% | 0% | 100%
lib/template/construct0% | 0% | 0% | 0% | 100%
codes/sample-frontend-flask/app0% | 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
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
constructor()
in infra/ecs-service/construct/ecs-infra-const.ts
62 5 3
private loadLayers()
in lib/template/pattern/lambda-pattern.ts
11 4 2
def log_to_backend()
in codes/sample-frontend-flask/app/main.py
4 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
private createVpc()
in infra/common-infra/vpc-infra-stack.ts
14 3 4
private getContainerImage()
in infra/ecs-service/construct/ecs-infra-const.ts
9 3 1
def __init__()
in codes/sample-backend-fastapi/app/ddb_handler.py
8 2 2
def get_items_count()
in codes/sample-backend-fastapi/app/ddb_handler.py
9 2 1
def put_item()
in codes/sample-backend-fastapi/app/ddb_handler.py
8 2 2
def read_item()
in codes/sample-backend-fastapi/app/main.py
8 2 0
public createIotMetric()
in lib/template/pattern/cloudwatch-pattern.ts
15 2 4