facebookresearch / AVID-CMA
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 181 units with 2,634 lines of code in units (66.7% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (309 lines of code)
    • 38 medium size units (1,231 lines of code)
    • 48 small units (649 lines of code)
    • 90 very small units (445 lines of code)
0% | 11% | 46% | 24% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 46% | 24% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
utils0% | 19% | 20% | 32% | 28%
ROOT0% | 33% | 53% | 8% | 3%
criterions0% | 14% | 52% | 26% | 6%
datasets0% | 0% | 75% | 15% | 8%
utils/videotransforms0% | 0% | 41% | 28% | 29%
utils/ioutils0% | 0% | 97% | 0% | 2%
models0% | 0% | 17% | 61% | 21%
utils/videotransforms/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build_dataloader()
in utils/main_utils.py
73 8 4
def __init__()
in criterions/avid_cma.py
64 7 14
def run_phase()
in eval-action-recg-linear.py
60 23 8
def run_phase()
in eval-action-recg.py
56 16 8
def build_dataloader()
in utils/eval_utils.py
56 10 5
def __init__()
in datasets/audioset.py
50 6 16
def __init__()
in datasets/video_db.py
50 6 20
def __getitem__()
in datasets/video_db.py
47 18 2
def __init__()
in datasets/kinetics.py
47 4 16
def av_laod_audio()
in utils/ioutils/av_wrappers.py
47 12 4
def __init__()
in criterions/avid.py
46 8 9
def main_worker()
in eval-action-recg.py
45 16 5
def __init__()
in datasets/hmdb.py
42 4 11
def run_phase()
in main-avid.py
42 17 10
def _get_clip()
in datasets/video_db.py
41 13 8
def main_worker()
in main-avid.py
38 11 4
def resize_clip()
in utils/videotransforms/functional.py
37 17 3
def __init__()
in datasets/ucf.py
36 5 11
def main_worker()
in eval-action-recg-linear.py
36 9 5
def __init__()
in datasets/preprocessing.py
35 5 3