facebookresearch / worldsheet
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 1,645 units with 15,416 lines of code in units (61.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (79 lines of code)
    • 24 medium complex units (1,147 lines of code)
    • 121 simple units (3,183 lines of code)
    • 1,499 very simple units (11,007 lines of code)
0% | <1% | 7% | 20% | 71%
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% | <1% | 7% | 20% | 71%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mmf/utils0% | 3% | 13% | 23% | 59%
mmf/models0% | 0% | 11% | 14% | 74%
mmf/datasets0% | 0% | 4% | 22% | 72%
tools/scripts0% | 0% | 22% | 0% | 77%
mmf/trainers0% | 0% | 12% | 14% | 73%
mmf/modules0% | 0% | 1% | 15% | 82%
mmf/common0% | 0% | 6% | 16% | 76%
mmf/neural_rendering0% | 0% | 0% | 30% | 69%
tools/sweeps0% | 0% | 0% | 50% | 50%
mmf_cli0% | 0% | 0% | 57% | 42%
ROOT0% | 0% | 0% | 0% | 100%
run_realestate10k0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def download()
in mmf/utils/download.py
79 27 5
def run_training_epoch()
in mmf/trainers/core/training_loop.py
70 23 1
def __call__()
in mmf/datasets/processors/processors.py
50 20 2
def add_sample_details()
in mmf/datasets/builders/textvqa/dataset.py
65 19 3
def _merge_with_dotlist()
in mmf/utils/configuration.py
58 18 3
def forward()
in mmf/models/mmf_bert.py
88 18 2
def __init__()
in mmf/utils/vocab.py
28 17 3
def preprocess_sample()
in mmf/models/mmf_transformer.py
56 17 3
def forward_losses()
in mmf/models/mesh_renderer.py
78 17 5
def load_state_dict()
in mmf/utils/checkpoint.py
36 16 1
def forward()
in mmf/models/mesh_renderer.py
48 16 2
def extract_dataset_pool5()
in tools/scripts/features/extract_resnet152_feat.py
42 15 5
def __init__()
in mmf/common/sample.py
32 14 2
def extract_features()
in tools/scripts/features/extract_features_vmb.py
43 13 1
def build()
in mmf/models/mesh_renderer.py
69 13 1
def save_forward_results()
in mmf/models/mesh_renderer.py
71 13 5
def _init_reader()
in mmf/datasets/databases/readers/feature_readers.py
16 12 1
def download_pretrained_model()
in mmf/utils/download.py
37 12 3
def infer_init_method()
in mmf/utils/distributed.py
47 12 1
def get_absolute_path()
in mmf/utils/general.py
25 12 1