aws-samples / aws-builders-fair-projects
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 19,904 units with 179,222 lines of code in units (62.8% of code).
    • 40 very long units (5,751 lines of code)
    • 264 long units (17,762 lines of code)
    • 1,592 medium size units (47,215 lines of code)
    • 2,982 small units (42,792 lines of code)
    • 15,026 very small units (65,702 lines of code)
3% | 9% | 26% | 23% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 10% | 25% | 23% | 37%
java20% | 3% | 34% | 18% | 23%
js<1% | 9% | 30% | 25% | 32%
cs0% | 24% | 32% | 18% | 24%
ino0% | 0% | 37% | 40% | 22%
ts0% | 0% | 36% | 27% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
reinvent-2020/RhythmCloud2% | 8% | 25% | 25% | 37%
reinvent-2019/rhythm-cloud2% | 9% | 23% | 24% | 39%
reinvent-2019/smart-garden15% | 9% | 21% | 24% | 28%
reinvent-2019/connected-photo-booth13% | 29% | 40% | 10% | 5%
reinvent-2019/iot-racing-ninja0% | 31% | 31% | 17% | 19%
reinvent-2019/learn-languages-ai-ml0% | 17% | 32% | 21% | 28%
reinvent-2020/aws-smart-recycle0% | 5% | 51% | 12% | 31%
reinvent-2019/lego-ev3-raspberry-pi-robot0% | 12% | 39% | 24% | 22%
reinvent-2019/drone-zone0% | 24% | 44% | 11% | 18%
reinvent-2019/doodlechallenge0% | 8% | 31% | 20% | 39%
reinvent-2019/polyglot-bot0% | 17% | 32% | 24% | 25%
reinvent-2019/sign-and-speak0% | 27% | 41% | 22% | 7%
reinvent-2019/autoponics0% | 30% | 12% | 14% | 42%
reinvent-2019/automatic-anomaly-detection-tool0% | 4% | 35% | 26% | 33%
reinvent-2019/fully-automated-farm0% | 0% | 28% | 29% | 41%
reinvent-2020/rock-a-bye-baby0% | 0% | 83% | 9% | 6%
reinvent-2019/deeppens0% | 0% | 55% | 6% | 37%
reinvent-2019/puente0% | 0% | 42% | 30% | 26%
reinvent-2019/smart-garage0% | 0% | 22% | 20% | 56%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def customCallback()
in reinvent-2019/connected-photo-booth/py_client/cerebro_processor.py
259 61 3
def make_field_element()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/docutils/writers/odf_odt/__init__.py
247 15 5
def make_field_element()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/docutils/writers/odf_odt/__init__.py
247 15 5
def _iter()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/rrule.py
224 97 1
def _iter()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/rrule.py
224 97 1
def _iter()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/rrule.py
224 97 1
public TemporalAnalyzerConstruct()
in reinvent-2020/RhythmCloud/analytics/rhythm-analyzer/rhythym-deploy/src/main/java/com/amazonaws/rhythmcloud/deployment/TemporalAnalyzerConstruct.java
209 1 3
def __init__()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/rrule.py
208 20 18
def __init__()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/rrule.py
208 20 18
def __init__()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/rrule.py
208 20 18
def parse()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/parser/_parser.py
159 18 2
def parse()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
159 18 2
def parse()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
159 18 2
def _parse_rfc()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/rrule.py
150 54 10
def __init__()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/docutils/writers/latex2e/__init__.py
123 19 3
def __init__()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/docutils/writers/latex2e/__init__.py
123 19 3
(function( factory )()
in reinvent-2019/rhythm-cloud/web/design/js/DataTables/Scroller-2.0.1/js/dataTables.scroller.js
121 18 1
(function( factory )()
in reinvent-2020/RhythmCloud/web/design/js/DataTables/Scroller-2.0.1/js/dataTables.scroller.js
121 18 1
def create_eye_mask_filter()
in reinvent-2019/connected-photo-booth/py_client/selfie_with_filters.py
119 3 1
def _parse_rfc()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/tz/tz.py
116 39 2