facebookresearch / EmpatheticDialogues
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 70 units with 1,234 lines of code in units (62.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (168 lines of code)
    • 7 simple units (204 lines of code)
    • 61 very simple units (862 lines of code)
0% | 0% | 13% | 16% | 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% | 13% | 16% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 50% | 11% | 37%
empchat/datasets0% | 0% | 0% | 29% | 70%
empchat0% | 0% | 0% | 8% | 91%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_model()
in retrieval_train.py
83 24 1
def get_bleu4()
in retrieval_eval_bleu.py
85 12 2
def build_bert_dictionary()
in empchat/datasets/loader.py
39 10 1
def __init__()
in empchat/datasets/loader.py
23 10 3
def train()
in retrieval_train.py
39 7 6
def getmode()
in empchat/datasets/dailydialog.py
13 7 2
def pad()
in empchat/datasets/loader.py
15 7 2
def build_valid_dataloader()
in empchat/datasets/loader.py
35 6 3
def __init__()
in empchat/bert_local.py
40 6 3
def embed_candidates()
in retrieval_eval_bleu.py
16 5 1
def predict()
in retrieval_eval_bleu.py
19 5 3
def load_embeddings()
in empchat/models.py
27 5 3
def load()
in empchat/models.py
17 5 2
def txt2vec()
in empchat/datasets/empchat.py
12 5 3
def forward()
in empchat/transformer_local.py
16 5 3
def forward()
in empchat/bert_local.py
24 5 3
def set_defaults()
in empchat/util.py
12 4 2
def read_dailydialog_data()
in empchat/datasets/dailydialog.py
41 4 2
def __init__()
in empchat/datasets/parlai_dictionary.py
17 4 2
def create_from_reddit_style()
in empchat/datasets/parlai_dictionary.py
11 4 1