aws-samples / cloudfront-authorization-at-edge
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 82 units with 1,569 lines of code in units (36.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (83 lines of code)
    • 7 simple units (405 lines of code)
    • 74 very simple units (1,081 lines of code)
0% | 0% | 5% | 25% | 68%
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% | 25% | 68%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/lambda-edge/parse-auth0% | 0% | 88% | 0% | 11%
src/cfn-custom-resources/us-east-1-lambda-stack0% | 0% | 0% | 73% | 26%
src/lambda-edge/shared0% | 0% | 0% | 33% | 66%
src/lambda-edge/refresh-auth0% | 0% | 0% | 84% | 15%
src/cfn-custom-resources/user-pool-client0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/react-app0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/lambda-code-update0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/client-secret-retrieval0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/user-pool-domain0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/static-site0% | 0% | 0% | 0% | 100%
src/cfn-custom-resources/generate-secret0% | 0% | 0% | 0% | 100%
src/lambda-edge/check-auth0% | 0% | 0% | 0% | 100%
src/lambda-edge/sign-out0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function validateQueryStringAndCookies()
in src/lambda-edge/parse-auth/index.ts
83 17 1
async function ensureUsEast1LambdaStack()
in src/cfn-custom-resources/us-east-1-lambda-stack/index.ts
96 8 1
export async function httpPostToCognitoWithRetry()
in src/lambda-edge/shared/shared.ts
52 7 4
function validateRefreshRequest()
in src/lambda-edge/refresh-auth/index.ts
43 6 6
function getDefaultCookieSettings()
in src/lambda-edge/shared/shared.ts
33 6 1
export function getCompleteConfig()
in src/lambda-edge/shared/shared.ts
36 6 0
async function ensureLambdaUsEast1Stack()
in src/cfn-custom-resources/us-east-1-lambda-stack/index.ts
82 6 1
async function ensureDeploymentUsEast1Stack()
in src/cfn-custom-resources/us-east-1-lambda-stack/index.ts
63 6 1
async function ensureCognitoUserPoolDomain()
in src/cfn-custom-resources/user-pool-domain/index.ts
29 5 3
export async function sendCfnResponse()
in src/cfn-custom-resources/user-pool-domain/cfn-response.ts
35 4 1
export async function sendCfnResponse()
in src/cfn-custom-resources/client-secret-retrieval/cfn-response.ts
35 4 1
async function uploadPages()
in src/cfn-custom-resources/static-site/index.ts
12 4 3
export async function sendCfnResponse()
in src/cfn-custom-resources/static-site/cfn-response.ts
35 4 1
export async function sendCfnResponse()
in src/cfn-custom-resources/generate-secret/cfn-response.ts
35 4 1
export async function sendCfnResponse()
in src/cfn-custom-resources/lambda-code-update/cfn-response.ts
35 4 1
async function buildUploadSpa()
in src/cfn-custom-resources/react-app/index.ts
13 4 3
export async function sendCfnResponse()
in src/cfn-custom-resources/react-app/cfn-response.ts
35 4 1
export async function sendCfnResponse()
in src/cfn-custom-resources/user-pool-client/cfn-response.ts
35 4 1
export async function sendCfnResponse()
in src/cfn-custom-resources/us-east-1-lambda-stack/cfn-response.ts
35 4 1
function randomChoiceFromIndexable()
in src/lambda-edge/check-auth/index.ts
13 3 1