facebookresearch / Clockwork
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 99 units with 336 lines of code in units (47.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 4 small units (59 lines of code)
    • 95 very small units (277 lines of code)
0% | 0% | 0% | 17% | 82%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 0% | 17% | 82%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common0% | 0% | 0% | 20% | 79%
planner0% | 0% | 0% | 0% | 100%
algorithm/right_based0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def str_to_memory()
in common/memory.py
20 5 1
def _set_time()
in common/time_interval.py
15 6 3
def _base_unit_multiple()
in common/memory.py
13 6 2
def _seconds_to_multiple()
in common/time_interval.py
11 5 2
def __sub__()
in common/time_interval.py
9 2 2
def __repr__()
in common/memory.py
8 4 1
def main()
in main.py
8 1 0
def get_algorithm()
in planner/config.py
7 1 3
def can_decrement()
in algorithm/right_based/algorithm.py
6 2 2
def _set_bytes()
in common/memory.py
6 3 4
def can_add()
in common/skyline_math.py
6 2 3
def can_remove()
in common/skyline_math.py
6 2 3
def _time_range()
in common/skyline_math.py
6 1 0
def __init__()
in common/timestamp.py
6 3 2
def get_task_fetcher()
in planner/config.py
5 1 3
def __init__()
in planner/config.py
5 1 0
def _get_updated_time_series()
in common/skyline_math.py
5 1 0
def _merge_time_series()
in common/skyline_math.py
5 1 0
def unique_task()
in common/data_types.py
5 1 1
def __post_init__()
in common/data_types.py
5 2 1