facebookresearch / spreadingvectors
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 84 units with 970 lines of code in units (66.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 12 simple units (401 lines of code)
    • 72 very simple units (569 lines of code)
0% | 0% | 0% | 41% | 58%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cpp0% | 0% | 0% | 47% | 52%
py0% | 0% | 0% | 36% | 63%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lattices0% | 0% | 0% | 40% | 59%
ROOT0% | 0% | 0% | 89% | 10%
lib0% | 0% | 0% | 26% | 73%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void ZnSphereCodecRec::decode()
in lattices/lattice_Zn.cpp
55 10 2
84 9 5
point_list_t sum_of_sq()
in lattices/lattice_utils.cpp
24 8 4
def sum_of_sq()
in lattices/Zn_lattice.py
18 8 3
long Repeats::encode()
in lattices/lattice_utils.cpp
28 7 1
void Repeats::decode()
in lattices/lattice_utils.cpp
31 7 2
float ZnSphereSearch::search()
in lattices/lattice_Zn.cpp
37 7 5
def evaluate()
in lib/metrics.py
33 7 8
def load_deep1b()
in lib/data.py
21 7 4
void ZnSphereCodec::decode()
in lattices/lattice_Zn.cpp
21 6 2
31 6 1
18 6 6
static long repeats_encode_64()
in lattices/lattice_utils.cpp
29 5 3
static void repeats_decode_64()
in lattices/lattice_utils.cpp
30 5 4
static inline __m128 masked_read()
in lattices/lattice_utils.cpp
14 5 2
void VectorCodec::find_nn()
in lattices/lattice_Zn.cpp
23 5 6
def getQuantizer()
in lib/quantizers.py
13 5 2
float fvec_inner_product()
in lattices/lattice_utils.cpp
28 4 3
float fvec_L2sqr()
in lattices/lattice_utils.cpp
31 4 3
def __init__()
in lattices/Zn_lattice.py
7 4 2