awslabs / aws-htc-grid
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 184 units with 2,025 lines of code in units (22.0% of code).
    • 1 very long units (110 lines of code)
    • 1 long units (59 lines of code)
    • 25 medium size units (821 lines of code)
    • 34 small units (493 lines of code)
    • 123 very small units (542 lines of code)
5% | 2% | 40% | 24% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 2% | 40% | 24% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/control_plane/python28% | 15% | 13% | 24% | 19%
source/client/python0% | 0% | 40% | 28% | 31%
source/compute_plane/python0% | 0% | 69% | 9% | 20%
deployment/grid/scripts0% | 0% | 0% | 86% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in source/control_plane/python/lambda/submit_tasks/submit_tasks.py
110 19 2
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 init()
in source/client/python/api-v0.1/api/connector.py
46 4 7
def claim_task_for_agent()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
43 5 5
def try_to_acquire_a_task()
in source/compute_plane/python/agent/agent.py
42 7 0
def _lambda_handler()
in source/compute_plane/python/lambda/drainer/handler.py
42 6 4
def acquire_task_for_ttl_lambda()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
42 5 4
def update_task_status_to_finished()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
40 5 3
def refresh_ttl_for_ongoing_task()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
38 5 4
def generate_user_task_json()
in source/client/python/api-v0.1/api/connector.py
37 4 2
def update_ttl_if_required()
in source/compute_plane/python/agent/agent.py
35 14 2
def __finalize_tasks_state()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
35 5 3
def create_kube_config()
in source/compute_plane/python/lambda/drainer/handler.py
34 1 2
def __get_tasks_by_state_key_expression()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
32 7 3
def retry_task()
in source/client/python/api-v0.1/api/state_table_dynamodb.py
31 4 3
def get_bearer_token()
in source/compute_plane/python/lambda/drainer/handler.py
30 1 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/compute_plane/python/lambda/scaling_metrics/scaling_metrics.py
29 1 2
def log()
in source/client/python/utils/utils/grid_error_logger.py
29 5 3