facebookresearch / LASER
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 71 units with 1,106 lines of code in units (48.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (114 lines of code)
    • 20 simple units (536 lines of code)
    • 47 very simple units (456 lines of code)
0% | 0% | 10% | 48% | 41%
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% | 10% | 48% | 41%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/lib0% | 0% | 20% | 48% | 31%
source0% | 0% | 9% | 46% | 44%
tasks/CCMatrix0% | 0% | 0% | 70% | 29%
tasks/bucc0% | 0% | 0% | 40% | 60%
docker0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def Token()
in source/lib/text_processing.py
32 15 9
def MarginAbs()
in source/paraphrase.py
22 12 5
def _make_batches()
in source/embed.py
28 11 2
def IndexSearchMultiple()
in source/lib/indexing.py
32 11 5
def dl_file()
in tasks/CCMatrix/dl_cc_matrix.py
49 10 3
def __init__()
in source/nli.py
38 10 8
def TestCorpus()
in source/nli.py
34 10 5
def __init__()
in source/sent_classif.py
33 9 7
def SplitLines()
in source/lib/text_processing.py
42 9 3
def validate()
in tasks/CCMatrix/dl_cc_matrix.py
26 8 2
def forward()
in source/embed.py
38 8 3
def IndexTextOpen()
in source/lib/indexing.py
41 8 1
def transpose_file()
in tasks/CCMatrix/dl_cc_matrix.py
26 7 2
17 7 4
def __init__()
in source/embed.py
21 7 8
def EncodeFile()
in source/embed.py
15 7 7
def IndexSearchKNN()
in source/lib/indexing.py
11 7 7
def BuccExtract()
in tasks/bucc/bucc.py
12 6 3
def sort_files()
in tasks/CCMatrix/dl_cc_matrix.py
30 6 3
def TextLoadUnify()
in source/mine_bitexts.py
24 6 2