awslabs / pptod
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 308 units with 5,875 lines of code in units (72.1% of code).
    • 2 very complex units (350 lines of code)
    • 7 complex units (449 lines of code)
    • 24 medium complex units (936 lines of code)
    • 62 simple units (1,834 lines of code)
    • 213 very simple units (2,306 lines of code)
5% | 7% | 15% | 31% | 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
py5% | 7% | 15% | 31% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
E2E_TOD14% | 12% | 21% | 28% | 22%
data/multiwoz0% | 9% | 17% | 33% | 39%
DST0% | 4% | 17% | 45% | 31%
Pretraining0% | 0% | 32% | 12% | 55%
data/pre-training_corpora0% | 0% | 0% | 31% | 68%
E2E_TOD/modelling0% | 0% | 0% | 42% | 57%
DST/modelling0% | 0% | 0% | 42% | 57%
IC0% | 0% | 0% | 17% | 82%
IC/modelling0% | 0% | 0% | 0% | 100%
Pretraining/modelling0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def clean_slot_values()
in E2E_TOD/clean_dataset.py
229 125 4
121 74 7
def queryJsons()
in E2E_TOD/db_ops.py
74 43 5
def queryJsons()
in data/multiwoz/utlis/db_ops.py
74 43 5
def batch_generate()
in E2E_TOD/inference_utlis.py
142 36 7
35 33 2
def domain_eval()
in E2E_TOD/eval.py
70 31 3
def get_exp_domains()
in E2E_TOD/reader.py
27 26 3
def get_exp_domains()
in data/multiwoz/utlis/reader.py
27 26 3
def bspan_to_constraint_dict()
in E2E_TOD/reader.py
46 24 3
def bspan_to_constraint_dict()
in data/multiwoz/utlis/reader.py
46 24 3
def compute_jacc()
in DST/compute_joint_acc.py
55 23 3
def aspan_to_act_list()
in E2E_TOD/reader.py
32 18 2
def e2e_batch_generate()
in E2E_TOD/e2e_inference_utlis.py
65 18 4
def aspan_to_act_list()
in data/multiwoz/utlis/reader.py
32 18 2
def score()
in E2E_TOD/eval.py
39 16 2
def padSeqs()
in data/multiwoz/utlis/utils.py
43 16 7
def querySQL()
in E2E_TOD/db_ops.py
36 15 3
def padSeqs()
in E2E_TOD/utils.py
43 15 7
def querySQL()
in data/multiwoz/utlis/db_ops.py
36 15 3