facebookresearch / MetaICL
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 630 units with 4,477 lines of code in units (53.6% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (227 lines of code)
    • 15 medium complex units (710 lines of code)
    • 18 simple units (381 lines of code)
    • 594 very simple units (3,159 lines of code)
0% | 5% | 15% | 8% | 70%
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% | 5% | 15% | 8% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
metaicl0% | 25% | 30% | 17% | 26%
preprocess0% | 2% | 9% | 5% | 83%
ROOT0% | 0% | 100% | 0% | 0%
utils0% | 0% | 0% | 84% | 15%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def preprocess()
in preprocess/utils.py
72 40 3
82 38 4
73 36 6
def main()
in test.py
76 25 2
def load_prompts()
in preprocess/utils.py
60 23 1
def process_test()
in preprocess/unifiedqa.py
52 21 4
def save()
in preprocess/fewshot_gym_dataset.py
44 20 7
def process_train()
in preprocess/unifiedqa.py
51 17 5
def tensorize()
in metaicl/data.py
51 17 5
def generate_k_shot_data()
in preprocess/fewshot_gym_dataset.py
33 14 4
def do_train()
in metaicl/model.py
50 14 8
def build_gym()
in preprocess/_build_gym.py
32 13 1
def md5_verify()
in preprocess/_build_gym.py
28 13 1
def apply_prompt()
in preprocess/utils.py
35 13 5
def run()
in test.py
55 13 10
def setup_optimizer()
in metaicl/model.py
39 13 6
52 13 2
def main()
in train.py
52 11 2
def load()
in metaicl/model.py
34 10 3
def evaluate()
in metaicl/data.py
24 10 4