tensorflow / kfac
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 799 units with 6,373 lines of code in units (90.0% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (185 lines of code)
    • 22 medium complex units (963 lines of code)
    • 48 simple units (1,208 lines of code)
    • 726 very simple units (4,017 lines of code)
0% | 2% | 15% | 18% | 63%
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% | 2% | 15% | 18% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
kfac/python/ops/tensormatch0% | 11% | 8% | 33% | 45%
kfac/python/ops0% | 1% | 15% | 14% | 68%
kfac/python/keras0% | 9% | 25% | 39% | 25%
kfac/python/ops/kfac_utils0% | 0% | 0% | 11% | 88%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _process_data()
in kfac/python/ops/fisher_blocks.py
54 31 2
def register_subgraph_layers()
in kfac/python/ops/tensormatch/graph_search.py
79 31 4
def register_layer()
in kfac/python/keras/utils.py
52 31 4
def make_inverse_update_ops()
in kfac/python/ops/fisher_factors.py
38 22 1
def __init__()
in kfac/python/ops/optimizer.py
135 18 34
def _compute_raw_update_steps()
in kfac/python/ops/optimizer.py
61 18 2
def _compute_new_cov()
in kfac/python/ops/fisher_factors.py
59 18 3
def get_loss_fn()
in kfac/python/keras/utils.py
35 17 6
def _register_block()
in kfac/python/ops/layer_collection.py
44 16 4
def set_global_constants()
in kfac/python/ops/fisher_factors.py
60 16 15
def register_scale_and_shift()
in kfac/python/ops/layer_collection.py
59 15 6
def filter_subgraph_records()
in kfac/python/ops/tensormatch/graph_search.py
22 15 1
def __init__()
in kfac/python/keras/optimizers.py
64 15 14
def _instantiate_factors()
in kfac/python/ops/estimator.py
38 14 1
def __init__()
in kfac/python/ops/fisher_factors.py
38 14 10
def _compute_qmodel_hyperparams()
in kfac/python/ops/optimizer.py
50 13 5
def num_conv_locations()
in kfac/python/ops/utils.py
26 12 4
def check_partial_batch_sizes()
in kfac/python/ops/fisher_factors.py
27 12 1
def __init__()
in kfac/python/keras/callbacks.py
24 12 7
def multiply_matpower()
in kfac/python/ops/fisher_blocks.py
33 11 3