amazon-research / hyperbolic-embeddings
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 187 units with 2,784 lines of code in units (89.5% of code).
    • 2 very complex units (871 lines of code)
    • 1 complex units (165 lines of code)
    • 6 medium complex units (456 lines of code)
    • 6 simple units (165 lines of code)
    • 172 very simple units (1,127 lines of code)
31% | 5% | 16% | 5% | 40%
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
py31% | 5% | 16% | 5% | 40%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
hype_kg/codes42% | 8% | 19% | 7% | 22%
hype_kg/codes/optimizers0% | 0% | 71% | 0% | 28%
product_matching0% | 0% | 0% | 5% | 94%
hype_kg/codes/manifolds0% | 0% | 0% | 0% | 100%
hype_kg/codes/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in hype_kg/codes/run.py
690 143 1
def forward()
in hype_kg/codes/model.py
181 65 5
def test_step()
in hype_kg/codes/model.py
165 27 5
def __init__()
in hype_kg/codes/model.py
132 25 25
def BoxTransE()
in hype_kg/codes/model.py
145 20 9
def step()
in hype_kg/codes/optimizers/radam.py
62 18 3
def forward()
in hype_kg/codes/model.py
28 14 3
def forward()
in hype_kg/codes/model.py
37 13 7
def TransE()
in hype_kg/codes/model.py
52 13 9
def forward()
in hype_kg/codes/model.py
26 7 5
def __init__()
in hype_kg/codes/model.py
30 7 9
def forward()
in hype_kg/codes/model.py
23 6 7
def forward()
in hype_kg/codes/model.py
22 6 7
def train_step()
in hype_kg/codes/model.py
47 6 5
def intersection_layer()
in product_matching/hyperboloid.py
17 6 2
def save_model()
in hype_kg/codes/run.py
24 5 5
def set_logger()
in hype_kg/codes/run.py
21 5 1
def gen_trigrams()
in product_matching/euclidean_intersection.py
10 5 1
def gen_trigrams()
in product_matching/hyperboloid.py
10 5 1
def collate_fn()
in hype_kg/codes/dataloader.py
7 4 1