awslabs / aws-htc-grid
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 184 units with 2,025 lines of code in units (22.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (145 lines of code)
    • 11 simple units (342 lines of code)
    • 171 very simple units (1,538 lines of code)
0% | 0% | 7% | 16% | 75%
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% | 7% | 16% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/control_plane/python0% | 0% | 28% | 22% | 49%
source/compute_plane/python0% | 0% | 8% | 34% | 56%
source/client/python0% | 0% | 0% | 9% | 90%
deployment/grid/scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in source/control_plane/python/lambda/submit_tasks/submit_tasks.py
110 19 2
def update_ttl_if_required()
in source/compute_plane/python/agent/agent.py
35 14 2
def get_tasks_statuses_in_session()
in source/control_plane/python/lambda/get_results/get_results.py
29 10 1
def lambda_handler()
in source/control_plane/python/lambda/ttl_checker/ttl_checker.py
59 10 2
def process_subprocess_completion()
in source/compute_plane/python/agent/agent.py
46 10 5
def pod_is_evictable()
in source/compute_plane/python/lambda/drainer/k8s_utils.py
12 8 1
def try_to_acquire_a_task()
in source/compute_plane/python/agent/agent.py
42 7 0
def batch_write()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
20 7 2
def __get_tasks_by_state_key_expression()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
32 7 3
def add_metric_sample()
in source/client/python/utils/utils/performance_tracker.py
18 7 6
def _lambda_handler()
in source/compute_plane/python/lambda/drainer/handler.py
42 6 4
def get_task_by_id()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
21 6 3
def get_results()
in source/client/python/api-v0.1/api/connector.py
21 6 3
def evict_pods()
in source/compute_plane/python/lambda/drainer/k8s_utils.py
27 5 2
def __get_to_bytes()
in source/client/python/api-v0.1/api/in_out_redis.py
20 5 3
def __get_to_utf8_string()
in source/client/python/api-v0.1/api/in_out_redis.py
20 5 3
def acquire_task_for_ttl_lambda()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
42 5 4
def claim_task_for_agent()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
43 5 5
def refresh_ttl_for_ongoing_task()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
38 5 4
def update_task_status_to_finished()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
40 5 3