amazon-research / contextual-attention-nlm
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 90 units with 1,029 lines of code in units (88.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (93 lines of code)
    • 7 simple units (224 lines of code)
    • 82 very simple units (712 lines of code)
0% | 0% | 9% | 21% | 69%
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% | 0% | 9% | 21% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 53% | 0% | 46%
src0% | 0% | 0% | 26% | 73%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in run_model.py
93 14 1
def forward()
in src/model.py
43 10 2
def custom_collate()
in src/data.py
34 9 1
def __init__()
in src/model.py
45 9 3
def __init__()
in src/model.py
36 8 4
def move_to_device()
in src/util.py
13 7 1
def forward()
in src/model.py
27 6 3
def forward()
in src/model.py
26 6 3
def get_tokenizer()
in src/tokenizer.py
21 5 5
26 5 1
def forward()
in src/model.py
20 5 3
def __init__()
in src/model.py
25 5 4
def init_base_lstm()
in src/model.py
20 5 2
11 5 1
def extract_radians()
in src/metadata.py
12 5 1
def setup_logger()
in run_model.py
15 4 1
def encode_text()
in src/tokenizer.py
10 4 4
def add_special_tokens()
in src/tokenizer.py
11 4 2
def list_files()
in src/data.py
4 4 2
10 4 4