amazon-research / tanl
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 136 units with 2,557 lines of code in units (77.6% of code).
    • 2 very complex units (300 lines of code)
    • 1 complex units (93 lines of code)
    • 9 medium complex units (414 lines of code)
    • 19 simple units (580 lines of code)
    • 105 very simple units (1,170 lines of code)
11% | 3% | 16% | 22% | 45%
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
py11% | 3% | 16% | 22% | 45%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT8% | 3% | 17% | 23% | 46%
preprocess_multiwoz58% | 0% | 0% | 5% | 35%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in run.py
210 67 0
def read_file()
in preprocess_multiwoz/extract_examples.py
90 51 11
def parse_output_sentence()
in output_formats.py
93 42 3
60 24 3
58 23 5
44 21 3
def run_inference()
in output_formats.py
52 20 7
50 17 5
64 17 3
def run_inference()
in output_formats.py
29 14 7
29 13 7
def run_inference()
in output_formats.py
28 13 5
35 10 3
115 10 6
12 10 1
55 10 6
def get_all_metrics()
in coreference_metrics.py
18 9 5
20 9 8
24 8 2
51 8 3