awslabs / aws-solutions-constructs
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 303 units with 7,031 lines of code in units (69.8% of code).
    • 1 very complex units (103 lines of code)
    • 1 complex units (138 lines of code)
    • 10 medium complex units (676 lines of code)
    • 37 simple units (1,637 lines of code)
    • 254 very simple units (4,477 lines of code)
1% | 1% | 9% | 23% | 63%
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
ts1% | 0% | 9% | 23% | 64%
js0% | 19% | 11% | 25% | 44%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/patterns/@aws-solutions-constructs1% | 0% | 11% | 24% | 62%
source/use_cases/aws-serverless-image-handler0% | 19% | 11% | 34% | 34%
source/tools/cdk-integ-tools0% | 0% | 0% | 29% | 70%
source/use_cases/aws-restaurant-management-demo0% | 0% | 0% | 0% | 100%
source/use_cases/aws-serverless-web-app0% | 0% | 0% | 0% | 100%
source/use_cases/aws-custom-glue-etl0% | 0% | 0% | 0% | 100%
source/use_cases/aws-s3-static-website0% | 0% | 0% | 0% | 100%
deployment/v20% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function CheckProps()
in source/patterns/@aws-solutions-constructs/core/lib/input-validation.ts
103 53 1
mapFilter()
in source/use_cases/aws-serverless-image-handler/lib/lambda/image-handler/thumbor-mapping.js
138 36 2
export function CheckFargateProps()
in source/patterns/@aws-solutions-constructs/core/lib/fargate-helper.ts
60 23 1
export function CheckAlbProps()
in source/patterns/@aws-solutions-constructs/core/lib/alb-helper.ts
49 17 1
async applyEdits()
in source/use_cases/aws-serverless-image-handler/lib/lambda/image-handler/image-handler.js
80 16 2
constructor()
in source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts
102 15 3
export function deployLambdaFunction()
in source/patterns/@aws-solutions-constructs/core/lib/lambda-helper.ts
87 15 4
constructor()
in source/patterns/@aws-solutions-constructs/aws-route53-alb/lib/index.ts
54 13 3
export function buildSagemakerNotebook()
in source/patterns/@aws-solutions-constructs/core/lib/sagemaker-helper.ts
66 13 2
constructor()
in source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/lib/index.ts
52 12 3
export function deployGlueJob()
in source/patterns/@aws-solutions-constructs/core/lib/glue-job-helper.ts
72 11 5
constructor()
in source/patterns/@aws-solutions-constructs/aws-lambda-s3/lib/index.ts
54 11 3
constructor()
in source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/lib/index.ts
68 10 3
constructor()
in source/patterns/@aws-solutions-constructs/aws-route53-apigateway/lib/index.ts
45 10 3
export function buildS3Bucket()
in source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-helper.ts
31 10 3
constructor()
in source/use_cases/aws-serverless-image-handler/lib/index.ts
59 10 3
async setup()
in source/use_cases/aws-serverless-image-handler/lib/lambda/image-handler/image-request.js
31 10 1
export function DefaultGlueJobProps()
in source/patterns/@aws-solutions-constructs/core/lib/glue-job-defaults.ts
17 9 4
function exec()
in source/tools/cdk-integ-tools/lib/integ-helpers.ts
29 9 5
constructor()
in source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/lib/index.ts
35 8 3