aws-samples / aws-cdk-project-template-for-devops
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 67 units with 711 lines of code in units (57.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (122 lines of code)
    • 26 small units (389 lines of code)
    • 37 very small units (200 lines of code)
0% | 0% | 17% | 54% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 15% | 58% | 26%
py0% | 0% | 30% | 27% | 42%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infra/stack0% | 0% | 44% | 23% | 32%
lib/template/pattern0% | 0% | 11% | 77% | 11%
codes/sample-backend-fastapi/app0% | 0% | 30% | 27% | 42%
lib/template0% | 0% | 26% | 45% | 27%
lib/template/stack0% | 0% | 0% | 69% | 30%
lib/template/construct0% | 0% | 0% | 76% | 23%
lib/template/common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
onPostConstructor()
in infra/stack/sample-vpc-ecs-stack.ts
36 1 1
private createLambda()
in lib/template/pattern/lambda-pattern.ts
33 11 4
def get_secret()
in codes/sample-backend-fastapi/app/main.py
27 8 1
private updateContextArgs()
in lib/template/app-context.ts
26 8 2
constructor()
in lib/template/construct/base/base-construct.ts
20 1 3
constructor()
in lib/template/stack/base/base-stack.ts
20 1 2
onPostConstructor()
in infra/stack/sample-vpc-rds-stack.ts
19 1 1
public createEndpointInstanceMetrics()
in lib/template/pattern/cloudwatch-pattern.ts
18 2 4
public createEndpointInvocationMetrics()
in lib/template/pattern/cloudwatch-pattern.ts
18 2 4
private findAppConfigFile()
in lib/template/app-context.ts
18 5 1
public createDynamoDBMetric()
in lib/template/pattern/cloudwatch-pattern.ts
16 3 4
public createEsDomainMetric()
in lib/template/pattern/cloudwatch-pattern.ts
16 2 4
public createEsDomainMetric2()
in lib/template/pattern/cloudwatch-pattern.ts
16 2 4
protected importVpc()
in lib/template/stack/vpc/vpc-base-stack.ts
16 5 1
public createWidget2()
in lib/template/pattern/cloudwatch-pattern.ts
15 1 3
public createLambdaMetric()
in lib/template/pattern/cloudwatch-pattern.ts
15 3 3
public createIotMetric()
in lib/template/pattern/cloudwatch-pattern.ts
15 2 4
private createRole()
in lib/template/pattern/lambda-pattern.ts
15 3 2
public createApiGatewayMetric()
in lib/template/pattern/cloudwatch-pattern.ts
14 2 3
public createSnsMetric()
in lib/template/pattern/cloudwatch-pattern.ts
14 2 3