facebookresearch / PyTorch-BigGraph
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 568 units with 3,932 lines of code in units (48.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (180 lines of code)
    • 9 medium complex units (566 lines of code)
    • 23 simple units (557 lines of code)
    • 535 very simple units (2,629 lines of code)
0% | 4% | 14% | 14% | 66%
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% | 4% | 10% | 14% | 69%
cpp0% | 0% | 88% | 0% | 11%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torchbiggraph0% | 4% | 15% | 14% | 64%
torchbiggraph/converters0% | 0% | 0% | 6% | 93%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _coordinate_train()
in torchbiggraph/train_gpu.py
180 33 4
void shuffle()
in torchbiggraph/util.cpp
90 19 3
def forward()
in torchbiggraph/model.py
104 18 2
def train()
in torchbiggraph/train_cpu.py
142 18 1
def map_with_type()
in torchbiggraph/schema.py
26 17 3
torch::Tensor randperm()
in torchbiggraph/util.cpp
84 15 3
def cat()
in torchbiggraph/edgelist.py
23 13 2
def start()
in torchbiggraph/parameter_sharing.py
51 12 2
def __attrs_post_init__()
in torchbiggraph/config.py
26 11 1
def build_nonbipartite_schedule_inner()
in torchbiggraph/train_gpu.py
20 11 1
def step()
in torchbiggraph/async_adagrad.py
45 10 2
def help()
in torchbiggraph/schema.py
28 10 1
def override_config_dict()
in torchbiggraph/config.py
18 9 2
def __init__()
in torchbiggraph/filtered_eval.py
29 9 3
def make_model()
in torchbiggraph/model.py
63 9 1
def step()
in torchbiggraph/row_adagrad.py
38 9 2
def represent_type()
in torchbiggraph/schema.py
21 9 2
def get_num_edge_chunks()
in torchbiggraph/train_cpu.py
11 8 1
def map_bool()
in torchbiggraph/schema.py
14 8 1
def __init__()
in torchbiggraph/entitylist.py
20 7 3