facebookresearch / barlowtwins
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 27 units with 392 lines of code in units (81.0% of code).
    • 1 very long units (124 lines of code)
    • 1 long units (71 lines of code)
    • 2 medium size units (53 lines of code)
    • 5 small units (69 lines of code)
    • 18 very small units (75 lines of code)
31% | 18% | 13% | 17% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py31% | 18% | 13% | 17% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT31% | 18% | 13% | 17% | 19%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main_worker()
in evaluate.py
124 23 2
71 12 2
def __init__()
in main.py
31 1 1
def step()
in main.py
22 9 1
def main()
in main.py
17 3 0
14 2 4
def __init__()
in main.py
14 4 2
def main()
in evaluate.py
12 3 0
def accuracy()
in evaluate.py
12 2 3
def forward()
in main.py
10 1 3
def resnet50()
in hubconf.py
7 2 2
def __init__()
in main.py
6 1 8
def __call__()
in main.py
6 2 2
def reset()
in evaluate.py
5 1 1
def update()
in evaluate.py
5 1 3
def __call__()
in main.py
5 2 2
def __init__()
in evaluate.py
4 1 3
4 1 1
def __call__()
in main.py
4 1 2
def handle_sigusr1()
in evaluate.py
3 1 2