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.
"If you have to spend effort into looking at a fragment of code to figure out what it's doing, then you should extract it into a function and name the function after that 'what'."
"Use common sense, stick to small function sizes in most instances but don't be dogmatic about it if you have a genuinely good reason to make an unusually big function."
"All other things being equal, a shorter method is easier to read, easier to understand, and easier to troubleshoot. Refactor long methods into smaller methods if you can."
"The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that. Functions should not be 100 lines long. Functions should hardly ever be 20 lines long."
Unit Size Overall
There are 19,904 units with 179,222 lines of code in units (62.8% of code).
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