aws-samples / aws-greengrass-mini-fulfillment
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 280 units with 4,210 lines of code in units (68.5% of code).
    • 2 very long units (376 lines of code)
    • 8 long units (482 lines of code)
    • 49 medium size units (1,519 lines of code)
    • 63 small units (934 lines of code)
    • 158 very small units (899 lines of code)
8% | 11% | 36% | 22% | 21%
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%
py4% | 12% | 38% | 23% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
groups/master/ggd/flask44% | 0% | 18% | 11% | 26%
groups28% | 19% | 27% | 14% | 10%
groups/arm/ggd0% | 12% | 45% | 25% | 16%
groups/lambda/MasterBrain0% | 49% | 50% | 0% | 0%
groups/master/ggd0% | 7% | 41% | 26% | 23%
groups/master/ggd/servo0% | 9% | 34% | 25% | 30%
groups/arm/ggd/servo0% | 9% | 34% | 25% | 30%
groups/lambda/ArmErrorDetector0% | 0% | 0% | 66% | 33%
groups/lambda/MasterErrorDetector0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
SmoothieChart.prototype.render = function()
in groups/master/ggd/flask/static/smoothie.js
196 46 2
def get_subscription_definition()
in groups/group_setup.py
180 1 2
def initialize()
in groups/arm/ggd/arm.py
70 6 6
def get_device_definition()
in groups/group_setup.py
68 1 2
def handle_button()
in groups/lambda/MasterBrain/master_brain.py
61 9 1
def stage_pick()
in groups/arm/ggd/stages.py
59 9 5
def initialize()
in groups/master/ggd/bridge.py
58 2 6
def bulk_read()
in groups/master/ggd/servo/servode.py
56 10 2
def bulk_read()
in groups/arm/ggd/servo/servode.py
56 10 2
def get_subscription_definition()
in groups/group_setup.py
54 1 2
def stage_sort()
in groups/arm/ggd/stages.py
45 2 2
def core_connect()
in groups/master/ggd/heartbeat.py
44 5 6
def core_connect()
in groups/arm/ggd/heartbeat.py
44 5 6
def index()
in groups/master/ggd/web.py
41 1 0
def local_shadow_connect()
in groups/master/ggd/utils.py
39 5 6
def read_register()
in groups/master/ggd/servo/servode.py
39 7 3
def local_shadow_connect()
in groups/arm/ggd/utils.py
39 5 6
def heartbeat()
in groups/arm/ggd/man_heartbeat.py
39 4 3
def read_register()
in groups/arm/ggd/servo/servode.py
39 7 3
SmoothieChart.prototype.updateValueRange = function()
in groups/master/ggd/flask/static/smoothie.js
38 12 0