facebookresearch / SimulEval
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 161 units with 1,020 lines of code in units (79.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (94 lines of code)
    • 4 simple units (125 lines of code)
    • 155 very simple units (801 lines of code)
0% | 0% | 9% | 12% | 78%
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% | 9% | 12% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
simuleval/utils0% | 0% | 68% | 0% | 31%
simuleval/metrics0% | 0% | 47% | 41% | 11%
simuleval/scorer0% | 0% | 0% | 21% | 78%
simuleval0% | 0% | 0% | 17% | 82%
simuleval/states0% | 0% | 0% | 0% | 100%
simuleval/online0% | 0% | 0% | 0% | 100%
simuleval/data0% | 0% | 0% | 0% | 100%
simuleval/agents0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def find_agent_cls()
in simuleval/utils/agent_finder.py
54 15 1
def latency_metric()
in simuleval/metrics/latency.py
40 11 1
def gather_translation()
in simuleval/scorer/scorer.py
21 10 1
def decode()
in simuleval/cli.py
30 7 4
def AverageLagging()
in simuleval/metrics/latency.py
35 6 5
def __init__()
in simuleval/scorer/scorer.py
39 6 2
def prediction()
in simuleval/scorer/instance.py
6 5 3
def send_src()
in simuleval/scorer/instance.py
32 5 2
def get_latency_score()
in simuleval/scorer/scorer.py
13 5 1
def update_target_segment()
in simuleval/states/states.py
12 5 1
def update_source_segment()
in simuleval/states/states.py
14 5 2
def load_text_file()
in simuleval/scorer/scorer.py
6 4 2
def evaluate()
in simuleval/cli.py
30 4 3
def _main()
in simuleval/cli.py
19 4 1
def get_source()
in simuleval/online/client.py
12 4 3
def end_idx_last_full_word()
in simuleval/data/tokenizer.py
7 4 2
def end_idx_last_full_word()
in simuleval/data/tokenizer.py
6 4 2
def states_type()
in simuleval/agents/agent.py
7 3 2
def new_class_names()
in simuleval/utils/agent_finder.py
9 3 1
def check_data_type()
in simuleval/utils/agent_finder.py
8 3 2