aws / amazon-codeguru-profiler-python-agent
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 268 units with 1,821 lines of code in units (81.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 16 simple units (309 lines of code)
    • 252 very simple units (1,512 lines of code)
0% | 0% | 0% | 16% | 83%
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% | 0% | 0% | 16% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
codeguru_profiler_agent0% | 0% | 0% | 28% | 71%
codeguru_profiler_agent/sdk_reporter0% | 0% | 0% | 17% | 82%
codeguru_profiler_agent/agent_metadata0% | 0% | 0% | 13% | 86%
codeguru_profiler_agent/model0% | 0% | 0% | 11% | 88%
codeguru_profiler_agent/aws_lambda0% | 0% | 0% | 17% | 82%
codeguru_profiler_agent/utils0% | 0% | 0% | 9% | 90%
ROOT0% | 0% | 0% | 0% | 100%
codeguru_profiler_agent/reporter0% | 0% | 0% | 0% | 100%
codeguru_profiler_agent/metrics0% | 0% | 0% | 0% | 100%
codeguru_profiler_agent/file_reporter0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _get_region_or_default()
in codeguru_profiler_agent/codeguru_client_builder.py
18 10 1
def wait_for_next_tick_or_stop()
in codeguru_profiler_agent/utils/execution_state.py
14 9 1
def __init__()
in codeguru_profiler_agent/profiler.py
45 9 5
def build_profiler()
in codeguru_profiler_agent/profiler_builder.py
31 8 8
def refresh_configuration()
in codeguru_profiler_agent/sdk_reporter/sdk_reporter.py
32 8 1
def _setup_final_environment()
in codeguru_profiler_agent/profiler.py
12 8 3
def get_metadata_for_configure_agent_call()
in codeguru_profiler_agent/agent_metadata/aws_lambda.py
24 7 2
def flush()
in codeguru_profiler_agent/local_aggregator.py
13 7 3
def __init__()
in codeguru_profiler_agent/model/call_graph_node.py
11 7 6
def main()
in codeguru_profiler_agent/__main__.py
50 7 3
def increment_sdk_error()
in codeguru_profiler_agent/agent_metadata/agent_debug_info.py
15 6 2
def _maybe_add_boto_operation_name()
in codeguru_profiler_agent/sampling_utils.py
10 6 2
def _maybe_update_line_no()
in codeguru_profiler_agent/model/call_graph_node.py
7 6 2
def _python36_extractor()
in codeguru_profiler_agent/aws_lambda/lambda_handler.py
7 6 2
def get_lambda_handler_extractor()
in codeguru_profiler_agent/aws_lambda/lambda_handler.py
9 6 0
def _remove_prefix_path()
in codeguru_profiler_agent/sdk_reporter/profile_encoder.py
11 6 2
def add_generic_metrics()
in codeguru_profiler_agent/agent_metadata/agent_debug_info.py
8 5 2
def is_overall_cpu_usage_limit_reached()
in codeguru_profiler_agent/profiler_disabler.py
15 5 2
def __init__()
in codeguru_profiler_agent/sampler.py
7 5 2
def _get_profiling_group_name_from_env()
in codeguru_profiler_agent/profiler_builder.py
6 5 2