facebookresearch / demucs
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 175 units with 2,943 lines of code in units (80.3% of code).
    • 1 very long units (156 lines of code)
    • 10 long units (805 lines of code)
    • 32 medium size units (948 lines of code)
    • 40 small units (571 lines of code)
    • 92 very small units (463 lines of code)
5% | 27% | 32% | 19% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 27% | 32% | 19% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
demucs6% | 30% | 28% | 18% | 16%
tools0% | 14% | 53% | 20% | 10%
demucs/grids0% | 0% | 53% | 46% | 0%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in demucs/hdemucs.py
156 27 36
def train()
in demucs/solver.py
100 28 1
def _run_one_epoch()
in demucs/solver.py
100 33 3
def __init__()
in demucs/demucs.py
99 13 26
def main()
in demucs/separate.py
96 12 0
def apply_model()
in demucs/apply.py
91 19 10
def evaluate()
in demucs/evaluate.py
89 17 2
def forward()
in demucs/hdemucs.py
67 21 2
def forward()
in demucs/hdemucs.py
57 15 4
def get_solver()
in demucs/train.py
55 14 2
def main()
in tools/automix.py
51 14 0
def read()
in demucs/audio.py
47 13 4
def align_stems()
in tools/automix.py
44 11 1
def __init__()
in demucs/hdemucs.py
42 8 16
def __init__()
in demucs/demucs.py
36 7 13
def analyse_track()
in tools/automix.py
35 6 2
def svd_penalty()
in demucs/svd.py
35 15 10
def __init__()
in demucs/solver.py
34 11 5
def __init__()
in demucs/hdemucs.py
34 7 14
def _track_metadata()
in demucs/wav.py
34 9 4