facebookresearch / FBTT-Embedding
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 30 units with 492 lines of code in units (15.5% of code).
    • 2 very long units (282 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (52 lines of code)
    • 6 small units (81 lines of code)
    • 20 very small units (77 lines of code)
57% | 0% | 10% | 16% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py57% | 0% | 10% | 16% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT57% | 0% | 10% | 16% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def reset_parameters()
in tt_embeddings_ops.py
142 17 2
def backward()
in tt_embeddings_ops.py
140 6 2
def _auto_shape()
in tt_embeddings_ops.py
30 10 2
def forward()
in tt_embeddings_ops.py
22 1 0
def __init__()
in tt_embeddings_ops.py
17 1 0
def __init__()
in tt_embeddings_ops.py
16 1 0
def cache_populate()
in tt_embeddings_ops.py
15 2 1
def generate_requests()
in tt_embeddings_benchmark.py
11 1 0
def main()
in tt_embeddings_benchmark.py
11 1 0
def full_weight()
in tt_embeddings_ops.py
11 1 1
def validate_list()
in tt_embeddings_benchmark.py
10 4 3
def __init__()
in tt_embeddings_ops.py
9 2 3
def __next__()
in tt_embeddings_ops.py
6 2 1
def tt_matrix_to_full()
in tt_embeddings_ops.py
6 1 0
def extend()
in tt_embeddings_ops.py
5 2 2
def reset_cache()
in tt_embeddings_ops.py
5 2 1
def get_params()
in tt_embeddings_ops.py
5 2 1
def append()
in tt_embeddings_ops.py
4 1 2
def benchmark_requests()
in tt_embeddings_benchmark.py
3 1 0
def __iter__()
in tt_embeddings_ops.py
3 1 1