facebookresearch / convit
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 80 units with 1,133 lines of code in units (91.2% of code).
    • 2 very long units (285 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (324 lines of code)
    • 17 small units (249 lines of code)
    • 51 very small units (275 lines of code)
25% | 0% | 28% | 21% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py25% | 0% | 28% | 21% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT25% | 0% | 28% | 21% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in main.py
163 39 1
122 1 0
def main()
in run_with_submitit.py
48 8 0
def log_every()
in utils.py
45 7 4
def __init__()
in convit.py
41 8 20
34 8 10
31 14 6
def __init__()
in datasets.py
31 4 8
def build_transform()
in datasets.py
27 4 2
def build_dataset()
in datasets.py
25 9 2
21 4 1
def __init__()
in convit.py
21 3 6
def evaluate()
in engine.py
19 3 3
19 2 3
18 3 3
def __init__()
in convit.py
18 3 9
def __init__()
in samplers.py
17 5 5
def __init__()
in datasets.py
16 4 9
def convit_tiny()
in models.py
14 2 2
def convit_small()
in models.py
14 2 2