apple / learning-compressible-subspaces
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 210 units with 2,606 lines of code in units (61.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 11 medium complex units (737 lines of code)
    • 21 simple units (520 lines of code)
    • 178 very simple units (1,349 lines of code)
0% | 0% | 28% | 19% | 51%
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% | 28% | 19% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 27% | 32% | 40%
models/networks0% | 0% | 48% | 0% | 51%
models0% | 0% | 13% | 9% | 77%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_method_config()
in get_training_params.py
100 23 2
def get_slimmed_network()
in models/networks/resprune.py
90 23 4
169 23 1
def _initialize_weights()
in models/networks/vgg.py
41 14 1
def get_slimmed_network()
in models/networks/vggprune.py
51 14 4
def forward()
in models/modules.py
35 13 2
def module_profiling()
in models/networks/model_profiling.py
85 13 4
def lec_update()
in train_indep.py
62 13 3
def quantized_args_dict()
in get_training_params.py
22 12 1
def forward()
in models/modules.py
51 12 2
def structured_args_dict()
in get_training_params.py
31 11 2
17 10 1
def gen_args_dict()
in get_training_params.py
24 10 1
def unstructured_args_dict()
in get_training_params.py
26 10 1
def train_model()
in train_curve.py
65 10 1
def train_model()
in train_indep.py
66 10 1
30 10 3
def get_stats()
in curve_utils.py
30 9 1
def forward()
in models/quantize_affine.py
32 9 4
29 9 2