facebookresearch / kbc
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 28 units with 215 lines of code in units (45.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (66 lines of code)
    • 1 medium size units (21 lines of code)
    • 3 small units (42 lines of code)
    • 23 very small units (86 lines of code)
0% | 30% | 9% | 19% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 30% | 9% | 19% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kbc0% | 30% | 9% | 19% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def prepare_dataset()
in kbc/process_datasets.py
66 16 2
def epoch()
in kbc/optimizers.py
21 2 2
def forward()
in kbc/models.py
17 1 2
def __init__()
in kbc/datasets.py
13 2 2
def score()
in kbc/models.py
12 1 2
def get_queries()
in kbc/models.py
9 1 2
def get_train()
in kbc/datasets.py
7 1 1
def forward()
in kbc/regularizers.py
7 2 2
def score()
in kbc/models.py
5 1 2
def forward()
in kbc/models.py
5 1 2
def forward()
in kbc/regularizers.py
5 2 2
def get_ranking()
in kbc/models.py
4 1 0
def get_rhs()
in kbc/models.py
4 1 3
def get_rhs()
in kbc/models.py
4 1 3
def avg_both()
in kbc/learn.py
4 1 4
def __init__()
in kbc/models.py
3 1 0
def __init__()
in kbc/models.py
3 1 0
def eval()
in kbc/datasets.py
3 1 8
def __init__()
in kbc/regularizers.py
3 1 2
def __init__()
in kbc/regularizers.py
3 1 2