aws-solutions / serverless-image-handler
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 73 units with 2,077 lines of code in units (71.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (318 lines of code)
    • 5 medium complex units (245 lines of code)
    • 16 simple units (477 lines of code)
    • 50 very simple units (1,037 lines of code)
0% | 15% | 11% | 22% | 49%
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% | 15% | 9% | 23% | 50%
js0% | 0% | 65% | 0% | 34%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
image-handler0% | 34% | 13% | 33% | 18%
custom-resource0% | 0% | 15% | 38% | 45%
demo-ui0% | 0% | 65% | 0% | 34%
constructs/lib0% | 0% | 0% | 0% | 100%
constructs/lib/common-resources0% | 0% | 0% | 0% | 100%
constructs/lib/back-end0% | 0% | 0% | 0% | 100%
solution-utils0% | 0% | 0% | 0% | 100%
constructs/lib/front-end0% | 0% | 0% | 0% | 100%
constructs/utils0% | 0% | 0% | 0% | 100%
custom-resource/lib0% | 0% | 0% | 0% | 100%
image-handler/lib0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public async applyEdits()
in source/image-handler/image-handler.ts
150 47 2
public mapFilter()
in source/image-handler/thumbor-mapper.ts
168 41 3
public async setup()
in source/image-handler/image-request.ts
48 23 1
function getPreviewImage()
in source/demo-ui/scripts.js
58 18 0
export async function handler()
in source/custom-resource/index.ts
66 18 2
async process()
in source/image-handler/image-handler.ts
38 11 1
public async getBoundingBox()
in source/image-handler/image-handler.ts
35 11 2
public parseRequestType()
in source/image-handler/image-request.ts
31 10 1
export async function handler()
in source/image-handler/index.ts
53 10 1
public inferImageType()
in source/image-handler/image-request.ts
24 9 1
private static convertImageFormatType()
in source/image-handler/image-handler.ts
20 8 1
private mapResize()
in source/image-handler/thumbor-mapper.ts
20 8 1
function getContentType()
in source/custom-resource/index.ts
19 7 1
async function checkSecretsManager()
in source/custom-resource/index.ts
33 7 1
async function checkFallbackImage()
in source/custom-resource/index.ts
31 7 1
public async getOriginalImage()
in source/image-handler/image-request.ts
34 7 2
public parseImageBucket()
in source/image-handler/image-request.ts
29 7 2
public async getOverlayImage()
in source/image-handler/image-handler.ts
36 7 6
public getCropArea()
in source/image-handler/image-handler.ts
21 7 3
async function copyS3Assets()
in source/custom-resource/index.ts
49 6 1