aws-samples / s3-object-lambda-workshop
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 23,908 units with 201,448 lines of code in units (47.8% of code).
    • 157 very long units (21,373 lines of code)
    • 291 long units (19,807 lines of code)
    • 1,597 medium size units (48,104 lines of code)
    • 2,861 small units (41,606 lines of code)
    • 19,002 very small units (70,558 lines of code)
10% | 9% | 23% | 20% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 9% | 24% | 21% | 32%
c49% | 15% | 15% | 8% | 11%
pyx8% | 13% | 26% | 19% | 31%
cc51% | 35% | 0% | 10% | 1%
h0% | 9% | 23% | 20% | 46%
pxi0% | 2% | 22% | 20% | 54%
pyi0% | 0% | 1% | 6% | 92%
js0% | 0% | 43% | 29% | 26%
hpp0% | 0% | 0% | 22% | 77%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amplify/backend/function10% | 9% | 23% | 20% | 35%
src/table0% | 0% | 34% | 28% | 38%
src/edit0% | 0% | 100% | 0% | 0%
src/create0% | 0% | 62% | 37% | 0%
src/list0% | 0% | 0% | 100% | 0%
src/navigation0% | 0% | 0% | 0% | 100%
src/navbar0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def analyzeline()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/f2py/crackfortran.py
529 179 3
void Object_beginTypeContext()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/src/ujson/python/objToJSON.c
447 92 2
def genfromtxt()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/lib/npyio.py
414 108 13
int parse_iso_8601_datetime()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/tslibs/src/datetime/np_datetime_strings.c
361 113 6
def analyzevars()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/f2py/crackfortran.py
335 161 1
int tokenize_bytes()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/src/parser/tokenizer.c
329 99 3
def _add_numeric_operations()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/core/generic.py
284 1 1
def _build_cluster_args()
in amplify/backend/function/iamxawswrangler/lib/python/awswrangler/emr.py
277 49 1
pyx
def maybe_convert_objects()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/lib.pyx
275 68 10
JSOBJ FASTCALL_MSVC decode_string()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/src/ujson/lib/ultrajsondec.c
251 62 1
int make_iso_8601_datetime()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/tslibs/src/datetime/np_datetime_strings.c
236 53 4
def _iter()
in amplify/backend/function/iamxawswrangler/lib/python/dateutil/rrule.py
224 97 1
pyx
def array_strptime()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/_libs/tslibs/strptime.pyx
221 71 4
def build_extension()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/distutils/command/build_ext.py
211 63 2
def __init__()
in amplify/backend/function/iamxawswrangler/lib/python/dateutil/rrule.py
208 20 18
def build_a_library()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/distutils/command/build_clib.py
202 60 4
def _daily_finder()
in amplify/backend/function/iamxawswrangler/lib/python/pandas/plotting/_matplotlib/converter.py
202 46 3
def loadtxt()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/lib/npyio.py
200 60 13
def readfortrancode()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/f2py/crackfortran.py
194 4 3
def conf_features_partial()
in amplify/backend/function/iamxawswrangler/lib/python/numpy/distutils/ccompiler_opt.py
193 23 1