facebookresearch / simsiam
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 33 units with 505 lines of code in units (74.7% of code).
    • 2 very long units (239 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (130 lines of code)
    • 3 small units (41 lines of code)
    • 23 very small units (95 lines of code)
47% | 0% | 25% | 8% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py47% | 0% | 25% | 8% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT50% | 0% | 27% | 5% | 16%
simsiam0% | 0% | 0% | 48% | 51%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main_worker()
in main_lincls.py
138 42 3
def main_worker()
in main_simsiam.py
101 21 3
def train()
in main_lincls.py
30 6 6
def validate()
in main_lincls.py
29 5 4
def train()
in main_simsiam.py
25 6 6
def main()
in main_simsiam.py
23 7 0
def main()
in main_lincls.py
23 7 0
def __init__()
in simsiam/builder.py
17 1 4
def sanity_check()
in main_lincls.py
12 5 2
def accuracy()
in main_lincls.py
12 2 3
def adjust_learning_rate()
in main_simsiam.py
7 4 4
def forward()
in simsiam/builder.py
6 2 3
def reset()
in main_simsiam.py
5 1 1
def update()
in main_simsiam.py
5 1 3
def reset()
in main_lincls.py
5 1 1
def update()
in main_lincls.py
5 1 3
def save_checkpoint()
in main_simsiam.py
4 2 3
def __init__()
in main_simsiam.py
4 1 3
def __init__()
in main_simsiam.py
4 1 4
def display()
in main_simsiam.py
4 2 2