facebookresearch / talkthewalk
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 129 units with 1,662 lines of code in units (65.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (65 lines of code)
    • 7 medium complex units (393 lines of code)
    • 16 simple units (410 lines of code)
    • 105 very simple units (794 lines of code)
0% | 3% | 23% | 24% | 47%
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% | 3% | 23% | 24% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ttw/models0% | 8% | 12% | 25% | 53%
ttw0% | 0% | 34% | 11% | 53%
scripts0% | 0% | 55% | 28% | 16%
ttw/train0% | 0% | 0% | 56% | 43%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def beam_search()
in ttw/models/beam_search.py
65 27 4
def evaluate()
in scripts/evaluate_location.py
87 17 9
def prediction_upperbound()
in scripts/compute_upperbound.py
34 15 8
def __init__()
in ttw/data_loader.py
37 14 7
def __init__()
in ttw/data_loader.py
51 13 7
def get_orientation_keys()
in ttw/data_loader.py
45 13 3
def forward()
in ttw/models/language.py
88 13 6
def __init__()
in ttw/data_loader.py
51 11 8
def forward()
in ttw/models/landmark_classification.py
33 10 2
def show_samples()
in ttw/models/language.py
24 10 8
def forward()
in ttw/models/language.py
44 10 3
def eval_epoch()
in ttw/train/predict_location_discrete.py
34 10 6
def get_configurations()
in scripts/split_dataset.py
32 10 1
def get_collate_fn()
in ttw/utils.py
19 9 1
def process()
in scripts/compute_upperbound.py
30 9 9
def to_variable()
in ttw/utils.py
10 8 2
def add_weights()
in ttw/train/classify_landmarks.py
22 8 2
def forward()
in ttw/models/discrete.py
26 7 3
def forward()
in ttw/models/continuous.py
22 7 3
def create_split()
in ttw/train/classify_landmarks.py
12 7 1