facebookresearch / bitsandbytes
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 239 units with 1,459 lines of code in units (33.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (113 lines of code)
    • 5 medium complex units (191 lines of code)
    • 14 simple units (311 lines of code)
    • 219 very simple units (844 lines of code)
0% | 7% | 13% | 21% | 57%
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% | 15% | 20% | 32% | 31%
h0% | 0% | 5% | 9% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
bitsandbytes/optim0% | 16% | 22% | 34% | 27%
include0% | 0% | 5% | 9% | 85%
bitsandbytes/nn0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def step()
in bitsandbytes/optim/adam.py
113 29 2
def load_state_dict()
in bitsandbytes/optim/optimizer.py
46 21 2
def init_state()
in bitsandbytes/optim/optimizer.py
37 14 5
def init_state()
in bitsandbytes/optim/optimizer.py
30 14 5
void vectorial()
in include/BinAlgo.h
37 11 3
def step()
in bitsandbytes/optim/lars.py
41 11 2
def __init__()
in bitsandbytes/optim/optimizer.py
32 9 6
def update_step()
in bitsandbytes/optim/optimizer.py
27 9 5
def update_step()
in bitsandbytes/optim/optimizer.py
26 9 5
static HResults computeH()
in include/Algo-Direct-Common.h
55 8 2
def override_config()
in bitsandbytes/optim/optimizer.py
29 8 5
def check_overrides()
in bitsandbytes/optim/optimizer.py
14 8 1
def step()
in bitsandbytes/optim/optimizer.py
19 8 2
def __init__()
in bitsandbytes/optim/lars.py
13 7 8
def __init__()
in bitsandbytes/optim/optimizer.py
29 7 6
static void populateIndex()
in include/Algo-Direct-Common.h
16 6 6
def __init__()
in bitsandbytes/optim/adagrad.py
14 6 12
def __init__()
in bitsandbytes/optim/adagrad.py
15 6 12
def __init__()
in bitsandbytes/optim/adagrad.py
14 6 12
def to_gpu()
in bitsandbytes/optim/optimizer.py
8 6 1