facebookresearch / gtn_applications
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 139 units with 1,952 lines of code in units (70.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (376 lines of code)
    • 28 simple units (658 lines of code)
    • 104 very simple units (918 lines of code)
0% | 0% | 19% | 33% | 47%
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% | 19% | 33% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 17% | 31% | 51%
scripts0% | 0% | 50% | 30% | 19%
benchmarks0% | 0% | 29% | 52% | 17%
datasets0% | 0% | 0% | 40% | 59%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def add_blank_grams()
in scripts/build_transitions.py
32 20 3
def train()
in train.py
194 20 2
def make_token_graph()
in transducer.py
27 17 3
def build_graph()
in scripts/build_transitions.py
36 14 2
def read_counts_from_arpa()
in scripts/load_arpa.py
38 13 1
def word_decompositions()
in benchmarks/transducer_benchmark.py
30 11 0
def iamdb_pieces()
in scripts/make_wordpieces.py
19 11 1
def add_self_loops()
in scripts/build_transitions.py
13 10 1
def json_set_pieces()
in scripts/make_wordpieces.py
18 10 3
def __init__()
in datasets/iamdb.py
41 9 5
20 9 2
def backward()
in utils.py
41 9 2
def to_index()
in datasets/audioset.py
13 8 2
def load_metadata()
in datasets/iamdb.py
23 8 3
15 8 2
15 8 2
def make_kernel_graph()
in transducer.py
17 7 5
def process()
in transducer.py
18 7 1
def to_index()
in datasets/iamdb.py
13 7 2
def test()
in test.py
60 7 1