amazon-research / statistical-byte-pair-encoding
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 49 units with 531 lines of code in units (96.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (119 lines of code)
    • 7 simple units (140 lines of code)
    • 38 very simple units (272 lines of code)
0% | 0% | 22% | 26% | 51%
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% | 22% | 26% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 22% | 26% | 51%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def sift_down()
in heap.py
27 13 2
24 12 2
def _update_stats()
in learn_bpe.py
25 12 7
def learn_bpe()
in learn_bpe.py
43 11 10
18 9 3
def pop_max()
in learn_bpe.py
36 9 1
def __init__()
in learn_bpe.py
22 8 3
22 6 1
def sift_up()
in heap.py
16 6 2
12 6 2
def __init__()
in learn_bpe.py
14 6 3
def main()
in learn_bpe.py
20 5 0
def remove()
in heap.py
12 4 2
def dfs()
in heap.py
11 4 2
14 4 3
def __init__()
in heap.py
20 3 7
8 3 2
def _swap_pos()
in heap.py
14 3 3
4 3 1
def insert()
in heap.py
13 2 2