facebookresearch / ssl-relation-prediction
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 83 units with 1,180 lines of code in units (81.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (164 lines of code)
    • 16 medium size units (565 lines of code)
    • 13 small units (185 lines of code)
    • 52 very small units (266 lines of code)
0% | 13% | 47% | 15% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 47% | 15% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 13% | 47% | 15% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def episode()
in src/engines.py
91 16 1
def prepare_dataset_ogb_biokg()
in src/preprocess_datasets.py
73 5 1
def prepare_dataset()
in src/preprocess_datasets.py
50 14 2
def forward()
in src/models.py
46 16 5
def __init__()
in src/datasets.py
46 8 3
def eval()
in src/datasets.py
43 8 9
def prepare_dataset_ogb_wikikg2()
in src/preprocess_datasets.py
41 2 1
def forward()
in src/models.py
41 16 6
def get_metric_ogb()
in src/models.py
36 7 5
def forward()
in src/models.py
36 16 5
def forward()
in src/models.py
35 18 6
def __init__()
in src/engines.py
34 1 2
def get_ranking()
in src/models.py
32 5 8
30 5 8
def forward()
in src/models.py
28 16 6
def filtering()
in src/models.py
24 12 8
def get_queries()
in src/models.py
22 4 3
def invert_torch()
in src/datasets.py
21 3 3
def batchify()
in src/datasets.py
20 3 4
def get_candidates()
in src/models.py
18 6 5