aws / aws-parallelcluster
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 2,507 units with 24,191 lines of code in units (55.5% of code).
    • 15 very long units (3,448 lines of code)
    • 17 long units (1,135 lines of code)
    • 230 medium size units (7,136 lines of code)
    • 332 small units (4,796 lines of code)
    • 1,913 very small units (7,676 lines of code)
14% | 4% | 29% | 19% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py14% | 4% | 29% | 19% | 31%
rb0% | 0% | 0% | 72% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
api/client32% | 5% | 40% | 7% | 14%
cli/src8% | 3% | 23% | 22% | 41%
awsbatch-cli/src8% | 0% | 34% | 34% | 21%
util0% | 17% | 36% | 25% | 19%
scheduler_plugins/slurm0% | 0% | 21% | 52% | 26%
cloudformation/utils0% | 0% | 0% | 39% | 60%
awsbatch-cli0% | 0% | 0% | 0% | 100%
cli0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in api/client/src/pcluster_client/api/cluster_operations_api.py
509 2 2
def __init__()
in api/client/src/pcluster_client/api/image_operations_api.py
474 2 2
def __init__()
in api/client/src/pcluster_client/api/cluster_logs_api.py
329 2 2
def __init__()
in api/client/src/pcluster_client/api/image_logs_api.py
320 2 2
def _add_head_node()
in cli/src/pcluster/templates/cluster_stack.py
307 27 1
def __init__()
in api/client/src/pcluster_client/api/cluster_instances_api.py
205 2 2
def __init__()
in api/client/src/pcluster_client/api/cluster_compute_fleet_api.py
194 2 2
def _add_imagebuilder_components()
in cli/src/pcluster/templates/imagebuilder_stack.py
172 17 3
def _add_lambda_cleanup()
in cli/src/pcluster/templates/imagebuilder_stack.py
169 4 3
def _build_policy()
in cli/src/pcluster/templates/cdk_builder_utils.py
149 9 1
def configure()
in cli/src/pcluster/cli/commands/configure/easyconfig.py
143 30 1
def _add_cw_log()
in cli/src/pcluster/templates/cw_dashboard_builder.py
136 10 1
def check_validations()
in api/client/src/pcluster_client/model_utils.py
120 39 4
def _get_parser()
in awsbatch-cli/src/awsbatch/awsbsub.py
112 1 0
def _add_batch_user_role()
in cli/src/pcluster/templates/awsbatch_builder.py
109 7 1
def request()
in api/client/src/pcluster_client/rest.py
87 26 9
def _add_private_hosted_zone()
in cli/src/pcluster/templates/slurm_builder.py
85 6 1
def _parse_args()
in util/update_pcluster_configs.py
83 3 0
def _add_default_instance_role()
in cli/src/pcluster/templates/imagebuilder_stack.py
78 10 3
def validate_and_convert_types()
in api/client/src/pcluster_client/model_utils.py
76 18 6