facebookresearch / online_dialog_eval
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 242 units with 3,928 lines of code in units (85.9% of code).
    • 1 very complex units (198 lines of code)
    • 2 complex units (137 lines of code)
    • 6 medium complex units (334 lines of code)
    • 31 simple units (889 lines of code)
    • 202 very simple units (2,370 lines of code)
5% | 3% | 8% | 22% | 60%
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
py5% | 3% | 8% | 22% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts50% | 23% | 0% | 12% | 13%
ROOT0% | 3% | 18% | 24% | 54%
codes0% | 0% | 6% | 34% | 59%
backup0% | 0% | 0% | 13% | 86%
backup/baselines/ruber0% | 0% | 0% | 14% | 85%
logbook0% | 0% | 0% | 16% | 83%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def prepare_corruptions()
in scripts/compute_corrupt.py
198 51 3
46 36 2
def main()
in scripts/interactive_file.py
91 31 1
85 24 3
67 18 1
def get_dataloader()
in codes/net.py
61 14 3
43 14 3
def get_sents()
in data.py
39 14 4
39 13 1
def preflight_steps()
in codes/models.py
61 10 1
def semantic_cluster()
in backup/analysis.py
54 10 1
24 10 1
27 10 1
31 10 1
36 10 1
39 10 1
def training_step()
in codes/net.py
47 9 3
19 9 2
13 8 1
def __init__()
in codes/models.py
58 8 3