facebookresearch / higher
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 65 units with 658 lines of code in units (54.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (199 lines of code)
    • 9 simple units (220 lines of code)
    • 52 very simple units (239 lines of code)
0% | 0% | 30% | 33% | 36%
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% | 30% | 33% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
higher0% | 0% | 30% | 33% | 36%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __setattr__()
in higher/patch.py
59 18 3
def _update()
in higher/optim.py
47 11 3
def _update()
in higher/optim.py
48 11 3
def _update()
in higher/optim.py
45 11 3
def _update()
in higher/optim.py
29 9 3
def _update()
in higher/optim.py
33 9 3
def _update()
in higher/optim.py
25 8 3
def _update()
in higher/optim.py
32 8 3
def patched_forward()
in higher/patch.py
18 7 4
def flatten()
in higher/utils.py
12 7 1
def _update()
in higher/optim.py
28 7 3
def _update()
in higher/optim.py
33 7 3
def _apply_override()
in higher/optim.py
10 6 2
def __init__()
in higher/patch.py
12 4 3
def _refill_params_box()
in higher/patch.py
9 4 2
def _is_container()
in higher/utils.py
8 4 1
def fast_params()
in higher/patch.py
8 3 2
def init_fast_params()
in higher/patch.py
7 2 1
def fast_params()
in higher/patch.py
2 2 1
def track_higher_grads()
in higher/patch.py
6 2 2