aws-samples / aws-research-workshops
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 170 units with 2,456 lines of code in units (44.0% of code).
    • 1 very long units (196 lines of code)
    • 3 long units (205 lines of code)
    • 29 medium size units (938 lines of code)
    • 37 small units (547 lines of code)
    • 100 very small units (570 lines of code)
7% | 8% | 38% | 22% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js44% | 0% | 18% | 11% | 26%
py0% | 10% | 42% | 24% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
notebooks/iot_greengress16% | 0% | 42% | 18% | 22%
lib0% | 19% | 41% | 18% | 19%
notebooks/parallelcluster0% | 26% | 8% | 29% | 35%
notebooks/ml_tensorflow0% | 0% | 39% | 43% | 17%
notebooks/escience_series0% | 0% | 35% | 21% | 42%
notebooks/serverless_apps0% | 0% | 34% | 51% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
SmoothieChart.prototype.render = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
196 46 2
77 10 1
def create_before()
in notebooks/parallelcluster/pcluster_athena.py
68 16 1
60 12 1
def model_fn()
in notebooks/ml_tensorflow/mnist.py
50 7 4
def get_subscription_definition()
in notebooks/iot_greengress/health_tracker/group_setup.py
48 1 2
def vpc_cleanup()
in lib/workshop.py
46 19 1
def core_connect()
in notebooks/iot_greengress/health_tracker/tracker/ggd/heartbeat.py
43 5 6
def get_device_definition()
in notebooks/iot_greengress/health_tracker/group_setup.py
39 1 2
def local_shadow_connect()
in notebooks/iot_greengress/health_tracker/tracker/ggd/utils.py
39 5 6
SmoothieChart.prototype.updateValueRange = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
38 12 0
37 5 5
def ggc_discovery()
in notebooks/iot_greengress/health_tracker/tracker/ggd/utils.py
37 7 4
36 1 0
def delete_job_queue()
in lib/workshop.py
36 8 1
def train()
in notebooks/escience_series/mnist.py
36 7 9
def _create_lambda_policies()
in notebooks/iot_greengress/health_tracker/lambda_setup.py
35 5 5
def create()
in notebooks/iot_greengress/health_tracker/lambda_setup.py
33 1 5
def index()
in notebooks/iot_greengress/health_tracker/tracker/ggd/web.py
32 1 0
def update()
in notebooks/serverless_apps/todos/update.py
30 3 2