facebookresearch / vilbert-multi-task
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 409 units with 8,574 lines of code in units (70.2% of code).
    • 2 very complex units (1,080 lines of code)
    • 3 complex units (655 lines of code)
    • 19 medium complex units (1,847 lines of code)
    • 28 simple units (935 lines of code)
    • 357 very simple units (4,057 lines of code)
12% | 7% | 21% | 10% | 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
py12% | 7% | 21% | 10% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT67% | 32% | 0% | 0% | <1%
vilbert0% | 6% | 19% | 16% | 58%
evaluation0% | 0% | 81% | 0% | 18%
vilbert/datasets0% | 0% | 14% | 17% | 68%
script0% | 0% | 17% | 3% | 78%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in train_tasks.py
519 92 0
def main()
in train_concap.py
561 87 0
def from_pretrained()
in vilbert/utils.py
136 37 4
def main()
in eval_retrieval.py
276 26 0
def main()
in eval_tasks.py
243 26 0
def main()
in evaluation/eval_coco_retrieval.py
248 20 0
def main()
in evaluation/eval_vqa.py
240 20 0
def load_tf_weights_in_bert()
in vilbert/vilbert.py
55 20 2
def _load_dataset()
in vilbert/datasets/vqa_dataset.py
106 18 3
def main()
in evaluation/eval_concap_retrieval.py
218 17 0
def LoadDatasets()
in vilbert/task_utils.py
115 16 4
def main()
in script/generate_demo.py
62 15 0
def _load_annotations()
in vilbert/datasets/visual7w_pointing_dataset.py
49 15 2
def main()
in evaluation/eval_refer_expression.py
188 14 0
def __getitem__()
in vilbert/datasets/visdial_dataset.py
99 14 2
def ForwardModelsVal()
in vilbert/task_utils.py
120 14 7
def _load_dataset()
in vilbert/datasets/gqa_dataset.py
41 13 3
def _load_annotations()
in vilbert/datasets/guesswhat_pointing_dataset.py
61 13 2
def tokenize()
in vilbert/datasets/vqa_mc_dataset.py
49 12 2
def _load_dataset()
in vilbert/datasets/visual_entailment_dataset.py
35 11 3