facebookresearch / poincare-embeddings
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 111 units with 1,001 lines of code in units (64.7% of code).
    • 1 very long units (137 lines of code)
    • 0 long units (0 lines of code)
    • 9 medium size units (263 lines of code)
    • 17 small units (253 lines of code)
    • 84 very small units (348 lines of code)
13% | 0% | 26% | 25% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py16% | 0% | 21% | 24% | 36%
pyx0% | 0% | 48% | 28% | 22%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT73% | 0% | 0% | 24% | 2%
hype0% | 0% | 42% | 27% | 29%
hype/manifolds0% | 0% | 12% | 21% | 66%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in embed.py
137 20 0
49 6 4
def expm()
in hype/manifolds/lorentz.py
33 9 6
pyx
def __cinit__()
in hype/graph_dataset.pyx
32 1 9
pyx
def _mk_weights()
in hype/graph_dataset.pyx
29 8 5
def __init__()
in hype/graph.py
28 4 6
def __getitem__()
in hype/sn.py
24 9 2
23 4 3
def main()
in hype/hypernymy_eval.py
23 7 2
pyx
def next()
in hype/adjacency_matrix_dataset.pyx
22 4 1
19 2 4
def ptransp()
in hype/manifolds/lorentz.py
18 4 6
18 5 4
17 2 7
def async_eval()
in embed.py
17 7 4
pyx
def __cinit__()
in hype/adjacency_matrix_dataset.pyx
17 1 7
pyx
def _worker()
in hype/adjacency_matrix_dataset.pyx
17 3 2
def step()
in hype/rsgd.py
16 6 4
def normalize()
in hype/manifolds/lorentz.py
16 3 2
pyx
def next()
in hype/graph_dataset.pyx
15 6 1