aws-samples / aws-secure-environment-accelerator
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 1,838 units with 36,684 lines of code in units (42.6% of code).
    • 46 very long units (9,195 lines of code)
    • 99 long units (6,934 lines of code)
    • 288 medium size units (8,953 lines of code)
    • 436 small units (6,377 lines of code)
    • 969 very small units (5,225 lines of code)
25% | 18% | 24% | 17% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts24% | 19% | 23% | 17% | 14%
py38% | 15% | 30% | 12% | 3%
tsx20% | 11% | 33% | 14% | 19%
js0% | 67% | 32% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/deployments35% | 27% | 22% | 8% | 6%
src/core45% | 35% | 8% | 5% | 5%
reference-artifacts/Custom-Scripts38% | 15% | 30% | 12% | 3%
src/installer96% | 0% | 0% | 3% | 0%
src/lib3% | 5% | 31% | 32% | 26%
src/ui19% | 13% | 31% | 14% | 21%
reference-artifacts/config-rules0% | 67% | 32% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/core/cdk/src/initial-setup.ts
937 4 3
constructor()
in src/installer/cdk/src/index.ts
521 3 3
constructor()
in src/deployments/cdk/src/common/vpc.ts
499 101 3
export async function deploy()
in src/deployments/cdk/src/apps/phase-1.ts
430 54 6
export async function deploy()
in src/deployments/cdk/src/apps/phase-2.ts
346 30 8
export async function step2()
in src/deployments/cdk/src/deployments/central-endpoints/step-2.ts
309 50 1
def impl()
in reference-artifacts/Custom-Scripts/Update-Scripts/v1.3.8_to_v1.5.0/update.py
297 78 5
constructor()
in src/deployments/cdk/src/common/iam-assets.ts
254 33 3
constructor()
in src/deployments/cdk/src/common/ad-users-groups.ts
252 2 3
def load_to_ddb()
in reference-artifacts/Custom-Scripts/Update-Scripts/v1.3.8_to_v1.5.0/update.py
247 24 3
constructor()
in src/core/cdk/src/tasks/create-stack-set-task.ts
232 1 3
async function assignDynamicCidrs()
in src/core/runtime/src/get-baseline-step.ts
205 64 1
export async function saveNetworkOutputs()
in src/core/runtime/src/save-outputs-to-ssm/network-outputs.ts
199 44 1
export async function step3()
in src/deployments/cdk/src/deployments/central-endpoints/step-3.ts
194 40 1
export async function step3()
in src/deployments/cdk/src/deployments/vpc/step-3.ts
190 32 1
export async function createRule()
in src/deployments/cdk/src/deployments/config/create.ts
187 38 1
export async function step4()
in src/deployments/cdk/src/deployments/central-endpoints/step-4.ts
186 32 1
export async function step2()
in src/deployments/cdk/src/deployments/opensearch-siem/step-2.ts
176 15 1
export async function deploy()
in src/deployments/cdk/src/apps/phase-5.ts
168 17 5
async function createCustomerGateways()
in src/deployments/cdk/src/deployments/firewall/cluster/step-2.ts
165 26 1