aws-samples / aws-comparing-algorithms-performance-mlops-cdk
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 22,127 units with 187,233 lines of code in units (70.1% of code).
    • 128 very long units (15,471 lines of code)
    • 206 long units (13,605 lines of code)
    • 1,299 medium size units (38,756 lines of code)
    • 3,207 small units (45,740 lines of code)
    • 17,287 very small units (73,661 lines of code)
8% | 7% | 20% | 24% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 7% | 20% | 24% | 39%
ts100% | 0% | 0% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/bucketFolderCreator53% | 3% | 12% | 12% | 16%
functions/predictionLambda4% | 7% | 21% | 25% | 41%
functions/cleanupLambda4% | 7% | 21% | 25% | 41%
functions/describeEndpointLambda4% | 7% | 21% | 25% | 41%
functions/invokeStateLambda4% | 7% | 21% | 25% | 41%
cdk-app/lib100% | 0% | 0% | 0% | 0%
cdk-app/scripts0% | 0% | 100% | 0% | 0%
functions/comparisonLambda0% | 0% | 0% | 100% | 0%
functions/startLambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk-app/lib/blog-resources-stack.ts
458 1 3
def make_field_element()
in functions/invokeStateLambda/docutils/writers/odf_odt/__init__.py
247 15 5
def make_field_element()
in functions/describeEndpointLambda/docutils/writers/odf_odt/__init__.py
247 15 5
def make_field_element()
in functions/predictionLambda/docutils/writers/odf_odt/__init__.py
247 15 5
def make_field_element()
in functions/cleanupLambda/docutils/writers/odf_odt/__init__.py
247 15 5
def _iter()
in functions/invokeStateLambda/dateutil/rrule.py
224 97 1
def _iter()
in functions/describeEndpointLambda/dateutil/rrule.py
224 97 1
def _iter()
in functions/predictionLambda/dateutil/rrule.py
224 97 1
def _iter()
in functions/cleanupLambda/dateutil/rrule.py
224 97 1
def __init__()
in functions/invokeStateLambda/dateutil/rrule.py
208 20 18
def __init__()
in functions/describeEndpointLambda/dateutil/rrule.py
208 20 18
def __init__()
in functions/predictionLambda/dateutil/rrule.py
208 20 18
def __init__()
in functions/cleanupLambda/dateutil/rrule.py
208 20 18
def parse()
in functions/invokeStateLambda/dateutil/parser/_parser.py
159 18 2
def parse()
in functions/describeEndpointLambda/dateutil/parser/_parser.py
159 18 2
def parse()
in functions/predictionLambda/dateutil/parser/_parser.py
159 18 2
def parse()
in functions/cleanupLambda/dateutil/parser/_parser.py
159 18 2
def __init__()
in functions/invokeStateLambda/docutils/writers/latex2e/__init__.py
123 21 3
def __init__()
in functions/describeEndpointLambda/docutils/writers/latex2e/__init__.py
123 21 3
def __init__()
in functions/predictionLambda/docutils/writers/latex2e/__init__.py
123 21 3