aws / aws-neuron-tensorflow
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 615 units with 10,612 lines of code in units (74.8% of code).
    • 4 very complex units (811 lines of code)
    • 11 complex units (1,252 lines of code)
    • 39 medium complex units (2,053 lines of code)
    • 79 simple units (2,394 lines of code)
    • 482 very simple units (4,102 lines of code)
7% | 11% | 19% | 22% | 38%
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
cc7% | 9% | 17% | 23% | 41%
py9% | 18% | 22% | 16% | 33%
h0% | 0% | 17% | 43% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
grappler11% | 0% | 26% | 32% | 29%
grappler/convert21% | 22% | 18% | 13% | 23%
python/hlo19% | 26% | 6% | 17% | 29%
python5% | 15% | 28% | 16% | 34%
runtime0% | 17% | 13% | 23% | 46%
runtime/direct0% | 0% | 9% | 15% | 75%
runtime/kernels0% | 0% | 14% | 52% | 32%
runtime/ops0% | 0% | 0% | 100% | 0%
tf2hlo0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
api0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Status PropagateShapes()
in grappler/shape_inference.cc
247 67 4
def inference_graph_from_session()
in python/graph_util.py
160 62 20
Status SegmentGraph()
in grappler/convert/segment.cc
231 57 6
def maybe_enable_dynamic_batch_size()
in python/hlo/optimize.py
173 51 1
351 47 2
def maybe_rewrite_batch_size()
in python/hlo/optimize.py
92 44 1
def compile_subgraphs()
in python/graph_util.py
121 41 6
def dynamic_inputs_outputs()
in python/graph_util.py
65 40 2
def fuse()
in python/fuse.py
122 38 14
def get_rtr_rewriter()
in python/hlo/optimize.py
52 35 3
tensorflow::Status ConvertSubGraphToNeuronNodeDef()
in grappler/convert/convert_graph.cc
239 34 1
def run_compiler_on_subgraphs()
in python/graph_def_util.py
61 32 2
def batchify_reshape_dot_reshape()
in python/hlo/optimize.py
54 30 1
def maybe_enable_rtr_shuffle()
in python/hlo/optimize.py
45 30 1
def restore_compiler_failures()
in python/graph_def_util.py
50 30 2
def inline_shape_inputs_in_subgraphs()
in python/graph_def_util.py
69 25 1
def normalize_operators()
in python/graph_def_util.py
41 24 1
def convert_to_inference_model()
in python/saved_model.py
69 23 13
Status CreateNeuronGraphDef()
in grappler/convert/convert_graph.cc
115 23 10
def whitelist_partition()
in python/graph_util.py
50 21 6