facebookresearch / diffq
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 91 units with 824 lines of code in units (82.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (27 lines of code)
    • 13 simple units (250 lines of code)
    • 77 very simple units (547 lines of code)
0% | 0% | 3% | 30% | 66%
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% | 3% | 29% | 66%
pyx0% | 0% | 0% | 35% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
diffq0% | 0% | 3% | 29% | 66%
ROOT0% | 0% | 0% | 35% | 64%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _find_params()
in diffq/base.py
27 13 1
def simple_repr()
in diffq/utils.py
22 9 3
def _unpack_param()
in diffq/ts_export.py
24 8 3
def clear_optimizer()
in diffq/diffq.py
12 7 2
def _pre_forward_train()
in diffq/diffq.py
23 7 1
def clear_optimizer()
in diffq/lsq.py
12 7 2
31 7 3
22 7 2
def setup_optimizer()
in diffq/diffq.py
14 6 4
def check_unused()
in diffq/diffq.py
8 6 1
def model_size()
in diffq/diffq.py
20 6 2
def setup_optimizer()
in diffq/lsq.py
13 6 3
def _codegen()
in diffq/ts_export.py
29 6 1
pyx
def _pack()
in bitpack.pyx
20 6 3
def _storage_size()
in diffq/torch_pack.py
11 5 1
def pack()
in diffq/torch_pack.py
18 5 3
def _register_param()
in diffq/diffq.py
26 5 5
def export()
in diffq/ts_export.py
29 5 3
def model_size()
in diffq/uniform.py
8 5 1
def unquantize()
in diffq/base.py
11 5 1