amazon-research / multiatis
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 53 units with 1,895 lines of code in units (73.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (170 lines of code)
    • 17 medium complex units (1,358 lines of code)
    • 3 simple units (53 lines of code)
    • 32 very simple units (314 lines of code)
0% | 8% | 71% | 2% | 16%
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% | 9% | 71% | 2% | 16%
pl0% | 0% | 100% | 0% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts0% | 8% | 71% | 2% | 16%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in code/scripts/bert_soft_align.py
170 34 3
def train()
in code/scripts/bert_alone.py
105 22 3
def train()
in code/scripts/bert_joint.py
105 22 3
def train()
in code/scripts/bert_mt.py
100 21 2
def train()
in code/scripts/lstm_joint.py
102 19 3
def train()
in code/scripts/lstm_alone.py
102 19 3
def train()
in code/scripts/lstm_mt.py
97 18 2
def evaluate()
in code/scripts/bert_mt.py
95 12 3
def evaluate()
in code/scripts/lstm_joint.py
95 12 3
def evaluate()
in code/scripts/bert_alone.py
95 12 3
def evaluate()
in code/scripts/bert_joint.py
95 12 3
sub endOfChunk()
in code/scripts/conlleval.pl
21 12 0
sub startOfChunk()
in code/scripts/conlleval.pl
21 12 0
def align_labels()
in code/scripts/translate_and_align.py
18 12 4
def evaluate()
in code/scripts/lstm_alone.py
95 12 3
def evaluate()
in code/scripts/bert_soft_align.py
95 12 3
def evaluate()
in code/scripts/lstm_mt.py
95 12 3
def get_label_indices()
in code/scripts/utils.py
22 11 1
def merge_slots()
in code/scripts/utils.py
13 7 2
def _compute_weight()
in code/scripts/layers.py
18 6 5