facebookresearch / bitext-lexind
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 48 units with 1,171 lines of code in units (74.3% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (178 lines of code)
    • 10 medium complex units (520 lines of code)
    • 7 simple units (171 lines of code)
    • 29 very simple units (302 lines of code)
0% | 15% | 44% | 14% | 25%
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% | 15% | 44% | 14% | 25%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
align0% | 24% | 32% | 18% | 24%
src0% | 0% | 64% | 7% | 28%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_word_aligns()
in align/models.py
80 48 7
def align_sents()
in align/models.py
98 34 4
def __init__()
in align/data.py
75 25 4
68 22 6
def collect_bitext_stats()
in src/weakly_sup.py
68 22 6
def collect_bitext_stats()
in src/fully_unsup.py
68 22 6
def extract_dataset()
in src/weakly_sup.py
33 16 4
def evaluate()
in src/evaluate.py
19 15 2
def inference()
in align/test.py
36 14 3
def train()
in align/train.py
56 12 2
def get_optimal_parameters()
in src/weakly_sup.py
41 11 7
def train_test()
in src/weakly_sup.py
56 11 2
def get_test_lexicon()
in src/weakly_sup.py
35 10 8
def eval_align()
in align/test.py
23 9 3
def evaluate()
in align/evaluate.py
23 9 3
def apply_distortion()
in align/models.py
8 8 2
def iter_max()
in align/models.py
27 6 2
def test()
in align/test.py
35 6 5
def filter()
in align/data.py
20 6 2
def get_max_weight_match()
in align/models.py
16 5 1