aws-samples / aws-secure-environment-accelerator
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 1,838 units with 36,684 lines of code in units (42.6% of code).
    • 4 very complex units (1,431 lines of code)
    • 13 complex units (2,402 lines of code)
    • 72 medium complex units (5,869 lines of code)
    • 130 simple units (4,957 lines of code)
    • 1,619 very simple units (22,025 lines of code)
3% | 6% | 15% | 13% | 60%
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
ts3% | 7% | 15% | 13% | 60%
py20% | 0% | 38% | 17% | 23%
tsx0% | 0% | 6% | 13% | 80%
js0% | 0% | 67% | 32% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/deployments6% | 15% | 20% | 16% | 40%
reference-artifacts/Custom-Scripts20% | 0% | 38% | 17% | 23%
src/core3% | 3% | 26% | 12% | 53%
src/lib0% | <1% | 6% | 10% | 82%
src/ui0% | 0% | 7% | 12% | 80%
reference-artifacts/config-rules0% | 0% | 67% | 32% | 0%
src/installer0% | 0% | 0% | 3% | 96%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in src/deployments/cdk/src/common/vpc.ts
499 101 3
def impl()
in reference-artifacts/Custom-Scripts/Update-Scripts/v1.3.8_to_v1.5.0/update.py
297 78 5
async function assignDynamicCidrs()
in src/core/runtime/src/get-baseline-step.ts
205 64 1
export async function deploy()
in src/deployments/cdk/src/apps/phase-1.ts
430 54 6
export async function step2()
in src/deployments/cdk/src/deployments/central-endpoints/step-2.ts
309 50 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 createRule()
in src/deployments/cdk/src/deployments/config/create.ts
187 38 1
constructor()
in src/deployments/cdk/src/common/iam-assets.ts
254 33 3
export async function step3()
in src/deployments/cdk/src/deployments/vpc/step-3.ts
190 32 1
export async function step4()
in src/deployments/cdk/src/deployments/central-endpoints/step-4.ts
186 32 1
export async function deploy()
in src/deployments/cdk/src/apps/phase-2.ts
346 30 8
export function getSubnetCidrPools()
in src/lib/common-outputs/src/cidr-pools.ts
40 28 1
export async function step3()
in src/deployments/cdk/src/deployments/firewall/cluster/step-3.ts
89 28 1
export async function step1()
in src/deployments/cdk/src/deployments/alb/step-1.ts
99 28 1
export async function step3()
in src/deployments/cdk/src/deployments/transit-gateway/step-3.ts
144 27 1
async function createCustomerGateways()
in src/deployments/cdk/src/deployments/firewall/cluster/step-2.ts
165 26 1
def generate_config_impl()
in reference-artifacts/Custom-Scripts/Conformance-Pack-Converter/generate-config-rules.py
44 25 1
export async function step1()
in src/deployments/cdk/src/deployments/transit-gateway/step-1.ts
78 25 1
def load_to_ddb()
in reference-artifacts/Custom-Scripts/Update-Scripts/v1.3.8_to_v1.5.0/update.py
247 24 3