facebookresearch / low-shot-shrink-hallucinate
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 86 units with 948 lines of code in units (73.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (109 lines of code)
    • 12 medium size units (357 lines of code)
    • 10 small units (159 lines of code)
    • 62 very small units (323 lines of code)
0% | 11% | 37% | 16% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 37% | 16% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 11% | 37% | 16% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
58 10 7
def train_analogy_regressor()
in analogy_generation.py
51 7 11
def train_matching_network()
in matching_network.py
47 6 10
def kmeans()
in torch_kmeans.py
36 7 4
def train_classifier()
in analogy_generation.py
34 7 10
def mine_analogies()
in analogy_generation.py
33 8 1
def do_generate()
in analogy_generation.py
33 9 4
def encode_lowshot_trainset()
in matching_network.py
30 2 6
def __init__()
in ResNetBasic.py
29 7 6
def run_test()
in matching_network.py
25 4 8
24 1 0
def eval_loop()
in low_shot.py
22 5 4
def __init__()
in ResNetBasic.py
22 6 4
def __init__()
in ResNetBasic.py
22 6 4
def parse_args()
in low_shot.py
20 1 0
def save_features()
in save_features.py
20 4 3
def training_loop()
in low_shot.py
19 3 5
def cluster_feats()
in analogy_generation.py
19 4 4
def __init__()
in low_shot.py
18 3 8
def parse_args()
in matching_network.py
14 1 0