apple / vqg-multimodal-assistant
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 44 units with 1,056 lines of code in units (75.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (89 lines of code)
    • 7 medium complex units (348 lines of code)
    • 6 simple units (197 lines of code)
    • 30 very simple units (422 lines of code)
0% | 8% | 32% | 18% | 39%
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% | 8% | 32% | 18% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 8% | 33% | 18% | 39%
commons_pkg0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def diverse_beam_search()
in question_generation_model.py
89 26 6
def beam_search()
in question_generation_model.py
78 23 5
64 19 1
def build()
in bert_layer.py
33 15 2
def greedy_search()
in question_generation_model.py
52 15 4
def dissimilarity_grouping()
in question_generation_model.py
32 13 4
def __init__()
in datasets.py
55 12 9
34 12 4
def load_embeddings()
in question_generation_model.py
21 9 1
29 8 3
def load_test_data()
in datasets.py
29 7 1
def test_model()
in question_generation_model.py
34 7 6
15 6 2
def generate_batch()
in question_generation_model.py
69 6 6
15 5 1
def call()
in bert_layer.py
18 4 2
def load_data()
in datasets.py
21 4 2
def load_dev_data()
in datasets.py
21 4 2
def train_model()
in question_generation_model.py
40 4 7
17 3 3