facebookresearch / spreadingvectors
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 84 units with 970 lines of code in units (66.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (139 lines of code)
    • 14 medium size units (390 lines of code)
    • 13 small units (182 lines of code)
    • 55 very small units (259 lines of code)
0% | 14% | 40% | 18% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 17% | 11% | 28% | 42%
cpp0% | 11% | 70% | 9% | 8%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 89% | 0% | 0% | 10%
lattices0% | 9% | 55% | 16% | 19%
lib0% | 0% | 20% | 30% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
84 9 5
void ZnSphereCodecRec::decode()
in lattices/lattice_Zn.cpp
55 10 2
float ZnSphereSearch::search()
in lattices/lattice_Zn.cpp
37 7 5
def evaluate()
in lib/metrics.py
33 7 8
void Repeats::decode()
in lattices/lattice_utils.cpp
31 7 2
float fvec_L2sqr()
in lattices/lattice_utils.cpp
31 4 3
31 6 1
static void repeats_decode_64()
in lattices/lattice_utils.cpp
30 5 4
static long repeats_encode_64()
in lattices/lattice_utils.cpp
29 5 3
long Repeats::encode()
in lattices/lattice_utils.cpp
28 7 1
float fvec_inner_product()
in lattices/lattice_utils.cpp
28 4 3
point_list_t sum_of_sq()
in lattices/lattice_utils.cpp
24 8 4
void VectorCodec::find_nn()
in lattices/lattice_Zn.cpp
23 5 6
23 4 1
void ZnSphereCodec::decode()
in lattices/lattice_Zn.cpp
21 6 2
def load_deep1b()
in lib/data.py
21 7 4
def __call__()
in lib/metrics.py
20 3 5
def sum_of_sq()
in lattices/Zn_lattice.py
18 8 3
18 6 6
def load_bigann()
in lib/data.py
17 3 4