aws-samples / cloudfront-authorization-at-edge
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 82 units with 1,569 lines of code in units (36.5% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (428 lines of code)
    • 22 medium size units (691 lines of code)
    • 15 small units (206 lines of code)
    • 39 very small units (244 lines of code)
0% | 27% | 44% | 13% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 27% | 44% | 13% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/cfn-custom-resources/us-east-1-lambda-stack0% | 73% | 10% | 10% | 6%
src/lambda-edge/parse-auth0% | 88% | 0% | 11% | 0%
src/lambda-edge/shared0% | 14% | 38% | 17% | 29%
src/cfn-custom-resources/lambda-code-update0% | 48% | 32% | 0% | 19%
src/cfn-custom-resources/user-pool-client0% | 0% | 67% | 20% | 12%
src/cfn-custom-resources/react-app0% | 0% | 79% | 11% | 9%
src/cfn-custom-resources/client-secret-retrieval0% | 0% | 90% | 0% | 9%
src/cfn-custom-resources/user-pool-domain0% | 0% | 90% | 0% | 9%
src/lambda-edge/refresh-auth0% | 0% | 84% | 0% | 15%
src/cfn-custom-resources/static-site0% | 0% | 61% | 21% | 17%
src/cfn-custom-resources/generate-secret0% | 0% | 83% | 0% | 16%
src/lambda-edge/check-auth0% | 0% | 0% | 68% | 31%
src/lambda-edge/sign-out0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function ensureUsEast1LambdaStack()
in src/cfn-custom-resources/us-east-1-lambda-stack/index.ts
96 8 1
function validateQueryStringAndCookies()
in src/lambda-edge/parse-auth/index.ts
83 17 1
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
export async function httpPostToCognitoWithRetry()
in src/lambda-edge/shared/shared.ts
52 7 4
async function updateLambdaCode()
in src/cfn-custom-resources/lambda-code-update/index.ts
52 2 4
async function updateUserPoolClient()
in src/cfn-custom-resources/user-pool-client/index.ts
47 2 4
function validateRefreshRequest()
in src/lambda-edge/refresh-auth/index.ts
43 6 6
export function getCompleteConfig()
in src/lambda-edge/shared/shared.ts
36 6 0
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
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
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 getDefaultCookieSettings()
in src/lambda-edge/shared/shared.ts
33 6 1
async function retrieveClientSecret()
in src/cfn-custom-resources/client-secret-retrieval/index.ts
32 3 4
async function ensureCognitoUserPoolDomain()
in src/cfn-custom-resources/user-pool-domain/index.ts
29 5 3