awslabs / damoos
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 52 units with 1,028 lines of code in units (95.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (77 lines of code)
    • 18 medium size units (569 lines of code)
    • 20 small units (294 lines of code)
    • 13 very small units (88 lines of code)
0% | 7% | 55% | 28% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 55% | 28% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
simple_rl_adapter0% | 58% | 19% | 9% | 12%
polyfit_adapter0% | 0% | 68% | 26% | 5%
pso_adapter0% | 0% | 46% | 43% | 9%
multiD_polyfit_adapter0% | 0% | 85% | 0% | 14%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in scheme_adapters/simple_rl_adapter/simple_rl_adapter.py
77 13 0
def parse_json()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
43 12 2
def collect_data()
in scheme_adapters/pso_adapter/pso_adapter.py
41 15 1
def run_best_workload()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
41 11 2
def parse_json()
in scheme_adapters/pso_adapter/pso_adapter.py
40 11 2
def collect_data()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
39 14 2
def polynomial_fit()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
34 11 6
def fit()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
33 6 2
def generate_search_param()
in scheme_adapters/pso_adapter/pso_adapter.py
32 8 1
def run_best_workload()
in scheme_adapters/pso_adapter/pso_adapter.py
32 7 2
def exploit_best_region()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
30 6 1
def get_metric()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
28 5 3
def __init__()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
27 1 4
def generate_json()
in scheme_adapters/multiD_polyfit_adapter/multiD_polyfit_adapter.py
27 9 2
def main()
in scheme_adapters/multiD_polyfit_adapter/multiD_polyfit_adapter.py
26 3 0
def step()
in scheme_adapters/simple_rl_adapter/simple_rl_adapter.py
26 1 2
def __init__()
in scheme_adapters/pso_adapter/pso_adapter.py
25 1 5
def generate_search_param()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
24 5 1
def main()
in scheme_adapters/polyfit_adapter/polyfit_adapter.py
21 1 0
def function()
in scheme_adapters/pso_adapter/pso_adapter.py
20 6 2