facebookresearch / multiset-compression
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 36 units with 500 lines of code in units (69.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (64 lines of code)
    • 0 medium complex units (0 lines of code)
    • 5 simple units (92 lines of code)
    • 30 very simple units (344 lines of code)
0% | 12% | 0% | 18% | 68%
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% | 12% | 0% | 18% | 68%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
experiments0% | 38% | 0% | 17% | 43%
multiset_codec0% | 0% | 0% | 20% | 79%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_single_experiment()
in experiments/jsonmaps.py
64 29 2
def run_single_experiment()
in experiments/mnist_lossy.py
29 7 2
def forward_lookup()
in multiset_codec/msbst.py
16 6 2
def reverse_lookup()
in multiset_codec/msbst.py
18 6 2
def insert_then_forward_lookup()
in multiset_codec/msbst.py
13 6 2
def reverse_lookup_then_remove()
in multiset_codec/msbst.py
16 6 2
def insert()
in multiset_codec/msbst.py
8 4 2
def remove()
in multiset_codec/msbst.py
10 4 2
def to_sequence()
in multiset_codec/msbst.py
12 4 1
def stack_slice()
in multiset_codec/rans.py
16 4 2
def run_single_experiment()
in experiments/toy_multisets.py
35 4 3
def run_all_experiments()
in experiments/toy_multisets.py
14 4 1
def Multiset()
in multiset_codec/codecs.py
21 3 1
def Sequence()
in multiset_codec/codecs.py
16 3 1
def base_message()
in multiset_codec/rans.py
7 3 2
def encode()
in multiset_codec/rans.py
10 2 4
def decode()
in multiset_codec/rans.py
16 2 2
def flatten()
in multiset_codec/rans.py
7 2 1
def run_all_experiments()
in experiments/jsonmaps.py
13 2 1
def run_all_experiments()
in experiments/mnist_lossy.py
11 2 1