facebookresearch / AVT
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 293 units with 4,121 lines of code in units (75.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (261 lines of code)
    • 17 medium complex units (959 lines of code)
    • 23 simple units (642 lines of code)
    • 252 very simple units (2,259 lines of code)
0% | 6% | 23% | 15% | 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% | 6% | 23% | 15% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
func0% | 37% | 15% | 5% | 41%
datasets0% | 0% | 31% | 30% | 38%
models0% | 0% | 36% | 7% | 56%
notebooks0% | 0% | 31% | 6% | 61%
ROOT0% | 0% | 26% | 15% | 57%
common0% | 0% | 0% | 16% | 83%
loss_fn0% | 0% | 0% | 36% | 63%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in func/train.py
261 43 1
62 22 1
69 22 6
def _sample()
in datasets/base_video_dataset.py
81 21 11
def __init__()
in datasets/base_video_dataset.py
97 17 4
def read_representations()
in datasets/epic_kitchens.py
37 14 4
def dense_labels_to_segments()
in datasets/base_video_dataset.py
33 14 6
54 14 6
def forward()
in models/future_prediction.py
89 13 3
def plot_per_cls_perf()
in notebooks/utils.py
72 13 10
def convert_to_anticipation()
in datasets/base_video_dataset.py
44 12 5
def __init__()
in models/future_prediction.py
50 12 16
def forward()
in models/base_model.py
24 12 4
def evaluate()
in func/train.py
76 12 8
def _get_video()
in datasets/base_video_dataset.py
40 11 2
def __init__()
in models/base_model.py
69 11 7
def read_results()
in notebooks/utils.py
32 11 3
def init_model()
in func/train.py
30 11 4
def classes_manyshot()
in datasets/epic_kitchens.py
26 10 1
def _read_rulstm_features()
in datasets/epic_kitchens.py
30 10 7