aws / 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 8,950 units with 87,114 lines of code in units (65.1% of code).
    • 2 very complex units (760 lines of code)
    • 16 complex units (1,726 lines of code)
    • 190 medium complex units (9,097 lines of code)
    • 543 simple units (13,359 lines of code)
    • 8,199 very simple units (62,172 lines of code)
<1% | 1% | 10% | 15% | 71%
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
ts<1% | 1% | 10% | 15% | 71%
py0% | 4% | 23% | 15% | 57%
js0% | 0% | 37% | 0% | 62%
go0% | 0% | 0% | 0% | 100%
cs0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/@aws-cdk1% | 2% | 9% | 14% | 73%
tools/@aws-cdk0% | 2% | 14% | 21% | 61%
packages/@aws-cdk-containers0% | 7% | 0% | 14% | 77%
packages/aws-cdk0% | 0% | 18% | 19% | 62%
packages/awslint0% | 0% | 19% | 33% | 47%
packages/aws-cdk-migration0% | 0% | 48% | 17% | 34%
scripts0% | 0% | 31% | 11% | 56%
packages/cdk-assets0% | 0% | 9% | 24% | 65%
packages/aws-cdk-lib0% | 0% | 25% | 19% | 55%
packages/@monocdk-experiment0% | 0% | 45% | 23% | 31%
packages/cdk-dasm0% | 0% | 0% | 84% | 15%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in packages/@aws-cdk/aws-opensearchservice/lib/domain.ts
381 97 3
constructor()
in packages/@aws-cdk/aws-elasticsearch/lib/domain.ts
379 95 3
constructor()
in packages/@aws-cdk/aws-lambda/lib/function.ts
160 41 3
constructor()
in packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts
79 35 3
constructor()
in packages/@aws-cdk/aws-eks/lib/cluster.ts
152 34 3
constructor()
in packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts
117 33 3
private parseIfCfnIntrinsic()
in packages/@aws-cdk/core/lib/cfn-parse.ts
138 32 1
constructor()
in packages/@aws-cdk/aws-ec2/lib/vpc.ts
90 31 3
private validateProps()
in packages/@aws-cdk/aws-batch/lib/compute-environment.ts
71 30 2
def handler()
in packages/@aws-cdk/aws-s3-deployment/lib/lambda/index.py
65 30 2
constructor()
in packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts
126 29 3
constructor()
in packages/@aws-cdk/aws-rds/lib/instance.ts
91 29 3
private toOriginProperty()
in packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts
103 29 2
constructor()
in packages/@aws-cdk/aws-codebuild/lib/project.ts
102 29 3
private emitResourceType()
in tools/@aws-cdk/cfn2ts/lib/codegen.ts
125 28 2
constructor()
in packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts
150 27 3
constructor()
in packages/@aws-cdk/aws-servicediscovery/lib/service.ts
61 26 3
constructor()
in packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts
96 26 3
public async deploy()
in packages/aws-cdk/lib/cdk-toolkit.ts
123 25 1
constructor()
in packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts
52 25 3