facebookresearch / ssl-relation-prediction
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 83 units with 1,180 lines of code in units (81.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (366 lines of code)
    • 7 simple units (176 lines of code)
    • 67 very simple units (638 lines of code)
0% | 0% | 31% | 14% | 54%
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
py0% | 0% | 31% | 14% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 31% | 14% | 54%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in src/models.py
35 18 6
def forward()
in src/models.py
36 16 5
def forward()
in src/models.py
46 16 5
def forward()
in src/models.py
41 16 6
def forward()
in src/models.py
28 16 6
def episode()
in src/engines.py
91 16 1
def prepare_dataset()
in src/preprocess_datasets.py
50 14 2
def filtering()
in src/models.py
24 12 8
def to_networkx()
in src/utils.py
15 11 9
def __init__()
in src/datasets.py
46 8 3
def eval()
in src/datasets.py
43 8 9
def get_metric_ogb()
in src/models.py
36 7 5
def get_candidates()
in src/models.py
18 6 5
def setup_model()
in src/engines.py
13 6 1
def get_grad_norm()
in src/utils.py
14 6 1
6 6 1
def prepare_dataset_ogb_biokg()
in src/preprocess_datasets.py
73 5 1
def get_ranking()
in src/models.py
32 5 8
30 5 8
def get_queries()
in src/models.py
11 4 3