aws / aws-sam-cli
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,865 units with 14,802 lines of code in units (57.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (50 lines of code)
    • 45 medium complex units (1,636 lines of code)
    • 140 simple units (2,723 lines of code)
    • 1,679 very simple units (10,393 lines of code)
0% | <1% | 11% | 18% | 70%
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
py0% | <1% | 11% | 18% | 69%
java0% | 0% | 0% | 0% | 100%
go0% | 0% | 0% | 0% | 100%
cs0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
samcli/lib/samlib0% | 30% | 0% | 28% | 41%
samcli/commands/deploy0% | 0% | 29% | 18% | 51%
samcli/local/apigw0% | 0% | 45% | 12% | 42%
samcli/commands/_utils0% | 0% | 19% | 7% | 72%
samcli/local/docker0% | 0% | 20% | 15% | 64%
samcli/lib/build0% | 0% | 11% | 15% | 73%
samcli/commands/build0% | 0% | 25% | 25% | 50%
samcli/commands/delete0% | 0% | 27% | 33% | 38%
samcli/cli0% | 0% | 11% | 25% | 63%
samcli/lib/utils0% | 0% | 6% | 5% | 87%
samcli/lib/iac0% | 0% | 11% | 2% | 86%
samcli/lib/cli_validation0% | 0% | 77% | 0% | 22%
samcli/lib/package0% | 0% | 7% | 37% | 55%
samcli/commands/pipeline0% | 0% | 12% | 33% | 53%
samcli/lib/deploy0% | 0% | 16% | 37% | 46%
samcli/lib/telemetry0% | 0% | 21% | 18% | 59%
samcli/lib/pipeline0% | 0% | 25% | 33% | 41%
samcli/commands/local0% | 0% | 4% | 17% | 77%
samcli/lib/intrinsic_resolver0% | 0% | 5% | 14% | 79%
samcli/lib/schemas0% | 0% | 11% | 26% | 61%
samcli/local/lambdafn0% | 0% | 9% | 17% | 72%
samcli/lib/observability0% | 0% | 7% | 13% | 78%
samcli/commands/validate0% | 0% | 23% | 18% | 58%
samcli/lib/sync0% | 0% | 2% | 12% | 84%
samcli/lib/providers0% | 0% | 3% | 21% | 74%
samcli/local/services0% | 0% | 38% | 36% | 24%
samcli/commands/init0% | 0% | 0% | 20% | 80%
samcli/lib/cookiecutter0% | 0% | 0% | 27% | 72%
samcli/local/lambda_service0% | 0% | 0% | 37% | 62%
samcli/lib/bootstrap0% | 0% | 0% | 9% | 90%
samcli/commands/package0% | 0% | 0% | 18% | 81%
samcli/lib/config0% | 0% | 0% | 33% | 66%
samcli/commands/publish0% | 0% | 0% | 62% | 37%
samcli/lib/warnings0% | 0% | 0% | 45% | 54%
samcli/local/events0% | 0% | 0% | 12% | 87%
samcli/lib/delete0% | 0% | 0% | 35% | 64%
samcli/lib/init0% | 0% | 0% | 11% | 88%
samcli/lib/docker0% | 0% | 0% | 30% | 69%
samcli0% | 0% | 0% | 34% | 65%
samcli/commands/logs0% | 0% | 0% | 15% | 84%
samcli/commands/sync0% | 0% | 0% | 0% | 100%
samcli/local/layers0% | 0% | 0% | 0% | 100%
samcli/commands/traces0% | 0% | 0% | 0% | 100%
samcli/lib/generated_sample_events0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
samcli/local/common0% | 0% | 0% | 0% | 100%
samcli/commands/bootstrap0% | 0% | 0% | 0% | 100%
samcli/commands0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def normalize()
in samcli/lib/samlib/resource_metadata_normalizer.py
50 27 2
def _parse_v1_payload_format_lambda_output()
in samcli/local/apigw/local_apigw_service.py
47 25 4
def _parse_v2_payload_format_lambda_output()
in samcli/local/apigw/local_apigw_service.py
41 22 3
def build()
in samcli/local/docker/lambda_image.py
42 21 8
def _request_handler()
in samcli/local/apigw/local_apigw_service.py
67 20 2
def _build_stack()
in samcli/lib/iac/cfn/cfn_iac.py
61 19 4
def image_repository_validation()
in samcli/lib/cli_validation/image_repository_validation.py
60 17 1
def convert()
in samcli/cli/types.py
31 17 4
def create()
in samcli/local/docker/container.py
51 16 1
def describe_stack_events()
in samcli/lib/deploy/deployer.py
50 16 4
def _collect_stages()
in samcli/lib/sync/flows/rest_api_sync_flow.py
28 16 1
def _replace_local_codeuri()
in samcli/commands/validate/lib/sam_template_validator.py
29 16 1
def _build_lambda_image()
in samcli/lib/build/app_builder.py
38 15 4
def artifact_callback()
in samcli/commands/_utils/options.py
16 15 4
def tail()
in samcli/lib/observability/cw_logs/cw_log_puller.py
30 14 3
def merge_routes()
in samcli/lib/providers/sam_api_provider.py
27 14 1
def track_command()
in samcli/lib/telemetry/metric.py
48 14 1
def on_change()
in samcli/lib/utils/file_observer.py
31 14 2
def convert()
in samcli/cli/types.py
22 14 4
def handle_parse_result()
in samcli/commands/local/cli_common/click_mutex.py
22 14 4