facebookresearch / CovidPrognosis
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 106 units with 1,128 lines of code in units (62.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (118 lines of code)
    • 3 simple units (46 lines of code)
    • 101 very simple units (964 lines of code)
0% | 0% | 10% | 4% | 85%
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% | 10% | 4% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cp_examples/sip_finetune0% | 0% | 25% | 11% | 62%
cp_examples/moco_pretrain0% | 0% | 39% | 0% | 60%
covidprognosis/data0% | 0% | 0% | 4% | 95%
cp_examples/mip_finetune0% | 0% | 0% | 0% | 100%
covidprognosis/plmodules0% | 0% | 0% | 0% | 100%
covidprognosis/models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def build_args()
in cp_examples/sip_finetune/train_sip.py
71 14 1
def build_args()
in cp_examples/moco_pretrain/train_moco.py
47 11 1
def validate_pretrained_model()
in cp_examples/sip_finetune/sip_finetune.py
14 8 2
def fetch_pos_weights()
in cp_examples/sip_finetune/train_sip.py
18 8 5
def __getitem__()
in covidprognosis/data/nih_chest_xrays.py
14 6 2
def fetch_label_list()
in covidprognosis/data/combined_datasets.py
11 5 2
def preproc_csv()
in covidprognosis/data/mimic_cxr.py
13 5 3
def _pool()
in cp_examples/mip_finetune/mip_model.py
14 5 3
def build_args()
in cp_examples/mip_finetune/train_mip.py
37 5 1
def fetch_pos_weights()
in cp_examples/mip_finetune/train_mip.py
13 5 4
def validation_epoch_end()
in cp_examples/sip_finetune/sip_finetune.py
28 5 2
def __getitem__()
in covidprognosis/data/chexpert.py
13 4 2
def __getitem__()
in covidprognosis/data/combined_datasets.py
8 4 2
def preproc_csv()
in covidprognosis/data/nih_chest_xrays.py
8 4 3
def __getitem__()
in covidprognosis/data/mimic_cxr.py
23 4 2
def load_pretrained_model()
in cp_examples/mip_finetune/mip_model.py
16 4 2
def validation_epoch_end()
in cp_examples/mip_finetune/mip_model.py
26 4 2
def configure_optimizers()
in cp_examples/sip_finetune/sip_finetune.py
13 4 1
def _dequeue_and_enqueue()
in covidprognosis/models/moco_model.py
11 3 2
def _batch_shuffle_ddp()
in covidprognosis/models/moco_model.py
11 3 2