facebookresearch / clutrr
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 142 units with 1,722 lines of code in units (79.1% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (246 lines of code)
    • 2 medium complex units (72 lines of code)
    • 21 simple units (447 lines of code)
    • 116 very simple units (957 lines of code)
0% | 14% | 4% | 25% | 55%
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% | 14% | 4% | 25% | 55%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
clutrr0% | 28% | 9% | 10% | 50%
clutrr/relations0% | 15% | 3% | 24% | 57%
clutrr/utils0% | 0% | 0% | 35% | 64%
clutrr/actors0% | 0% | 0% | 47% | 52%
clutrr/store0% | 0% | 0% | 100% | 0%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_rows()
in clutrr/generator.py
150 47 5
def generate_text()
in clutrr/relations/puzzle.py
41 31 5
def add_facts_to_puzzle()
in clutrr/relations/builder.py
55 27 2
def compose_rel()
in clutrr/relations/builder.py
20 12 5
def store()
in clutrr/main.py
52 12 4
def main()
in clutrr/template_mturk.py
33 10 0
def prune_puzzles()
in clutrr/relations/builder.py
21 10 2
def precompute_expansions()
in clutrr/relations/builder.py
17 10 3
def derive()
in clutrr/relations/builder.py
21 10 3
def upload()
in clutrr/utils/data_backend.py
25 10 3
def add_work_relations()
in clutrr/actors/ancestry.py
34 10 2
def convert_node_ids()
in clutrr/relations/puzzle.py
16 9 2
def get_peer()
in clutrr/utils/data_backend.py
27 9 3
def split_train_test()
in clutrr/utils/utils.py
15 9 2
def simulate()
in clutrr/actors/ancestry.py
22 9 1
def __init__()
in clutrr/store/store.py
20 9 2
def almost_complete()
in clutrr/relations/builder.py
13 8 2
def expand()
in clutrr/relations/builder.py
15 8 3
def next_flip()
in clutrr/actors/ancestry.py
25 8 1
def get_sorted_story_edges()
in clutrr/relations/puzzle.py
11 7 2