aws-samples / faropt
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 3,331 units with 36,275 lines of code in units (82.9% of code).
    • 10 very long units (1,402 lines of code)
    • 77 long units (5,065 lines of code)
    • 332 medium size units (9,864 lines of code)
    • 607 small units (8,722 lines of code)
    • 2,305 very small units (11,222 lines of code)
3% | 13% | 27% | 24% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 13% | 27% | 24% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib644% | 14% | 26% | 23% | 31%
lib4% | 14% | 26% | 23% | 31%
faropt0% | 100% | 0% | 0% | 0%
sdk0% | 0% | 54% | 36% | 9%
lambda0% | 0% | 100% | 0% | 0%
lambda20% | 0% | 64% | 29% | 6%
lambda30% | 0% | 100% | 0% | 0%
Dockerstuff0% | 0% | 0% | 81% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def move_wheel_files()
in lib64/python3.6/dist-packages/pip/_internal/wheel.py
185 56 11
def move_wheel_files()
in lib/python3.6/dist-packages/pip/_internal/wheel.py
185 56 11
def run()
in lib64/python3.6/dist-packages/pip/_internal/commands/install.py
174 23 3
def run()
in lib/python3.6/dist-packages/pip/_internal/commands/install.py
174 23 3
def __init__()
in lib64/python3.6/dist-packages/pip/_internal/commands/install.py
126 1 3
def __init__()
in lib/python3.6/dist-packages/pip/_internal/commands/install.py
126 1 3
def freeze()
in lib64/python3.6/dist-packages/pip/_internal/operations/freeze.py
115 21 9
def freeze()
in lib/python3.6/dist-packages/pip/_internal/operations/freeze.py
115 21 9
def from_dist()
in lib64/python3.6/dist-packages/pip/_internal/req/req_uninstall.py
101 35 2
def from_dist()
in lib/python3.6/dist-packages/pip/_internal/req/req_uninstall.py
101 35 2
def build()
in lib64/python3.6/dist-packages/pip/_internal/wheel.py
98 35 4
def finalize_options()
in lib64/python3.6/dist-packages/setuptools/command/easy_install.py
98 17 1
def upload_file()
in lib64/python3.6/dist-packages/setuptools/command/upload.py
98 22 4
def build()
in lib/python3.6/dist-packages/pip/_internal/wheel.py
98 35 4
def finalize_options()
in lib/python3.6/dist-packages/setuptools/command/easy_install.py
98 17 1
def upload_file()
in lib/python3.6/dist-packages/setuptools/command/upload.py
98 22 4
def __init__()
in faropt/faropt_stack.py
97 6 4
def call_subprocess()
in lib64/python3.6/dist-packages/pip/_internal/utils/misc.py
83 11 8
def call_subprocess()
in lib/python3.6/dist-packages/pip/_internal/utils/misc.py
83 11 8
def setup_logging()
in lib64/python3.6/dist-packages/pip/_internal/utils/logging.py
78 10 3