aws / aws-parallelcluster-cookbook
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 201 units with 1,873 lines of code in units (26.1% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (120 lines of code)
    • 12 medium size units (352 lines of code)
    • 49 small units (714 lines of code)
    • 138 very small units (687 lines of code)
0% | 6% | 18% | 38% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 21% | 33% | 39%
rb0% | 6% | 15% | 44% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cookbooks/aws-parallelcluster-install0% | 31% | 23% | 19% | 25%
cookbooks/aws-parallelcluster-scheduler-plugin0% | 13% | 16% | 35% | 34%
cookbooks/aws-parallelcluster-config0% | 0% | 19% | 35% | 45%
cookbooks/aws-parallelcluster-test0% | 0% | 25% | 68% | 5%
cookbooks/aws-parallelcluster-slurm0% | 0% | 35% | 39% | 25%
libraries0% | 0% | 7% | 40% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in cookbooks/aws-parallelcluster-install/files/default/ec2_udev_rules/attachVolume.py
65 12 0
build_env
in cookbooks/aws-parallelcluster-scheduler-plugin/resources/execute_event_handler.rb
55 14 0
def main()
in cookbooks/aws-parallelcluster-install/files/default/ec2_udev_rules/ec2_dev_2_volid.py
49 10 0
def main()
in cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/pcluster_slurm_config_generator.py
48 2 0
def _get_session_token()
in cookbooks/aws-parallelcluster-config/files/default/dcv/pcluster_dcv_authenticator.py
36 8 2
allow_gpu_acceleration
in cookbooks/aws-parallelcluster-config/recipes/dcv.rb
34 7 0
check_sudoers_permissions
in cookbooks/aws-parallelcluster-test/libraries/helpers.rb
25 4 5
add_package_repository
in libraries/helpers.rb
25 3 4
build_static_env
in cookbooks/aws-parallelcluster-scheduler-plugin/resources/execute_event_handler.rb
24 2 4
check_run_level_script
in cookbooks/aws-parallelcluster-test/libraries/helpers.rb
23 7 3
def update_status()
in cookbooks/aws-parallelcluster-scheduler-plugin/files/default/clusterstatusmgtd/clusterstatusmgtd.py
22 2 3
def _call_update_event()
in cookbooks/aws-parallelcluster-scheduler-plugin/files/default/clusterstatusmgtd/clusterstatusmgtd.py
22 2 1
def add_scheduler_plugin_log()
in cookbooks/aws-parallelcluster-config/files/default/cloudwatch_agent/write_cloudwatch_agent_json.py
22 4 2
def do_GET()
in cookbooks/aws-parallelcluster-config/files/default/dcv/pcluster_dcv_authenticator.py
22 6 1
def _get_basic_config()
in cookbooks/aws-parallelcluster-scheduler-plugin/files/default/clusterstatusmgtd/clusterstatusmgtd.py
20 2 2
def _run_clusterstatusmgtd()
in cookbooks/aws-parallelcluster-scheduler-plugin/files/default/clusterstatusmgtd/clusterstatusmgtd.py
20 4 1
build_dynamic_env
in cookbooks/aws-parallelcluster-scheduler-plugin/resources/execute_event_handler.rb
20 5 2
def parse_args()
in cookbooks/aws-parallelcluster-config/files/default/cloudwatch_agent/write_cloudwatch_agent_json.py
20 1 0
def do_POST()
in cookbooks/aws-parallelcluster-config/files/default/dcv/pcluster_dcv_authenticator.py
20 4 1
def manage_cluster_status()
in cookbooks/aws-parallelcluster-scheduler-plugin/files/default/clusterstatusmgtd/clusterstatusmgtd.py
19 4 1