microsoft / onnxconverter-common
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 560 units with 5,530 lines of code in units (92.3% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (647 lines of code)
    • 30 medium complex units (922 lines of code)
    • 68 simple units (1,332 lines of code)
    • 454 very simple units (2,629 lines of code)
0% | 11% | 16% | 24% | 47%
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% | 11% | 16% | 24% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
onnxconverter_common0% | 11% | 16% | 24% | 47%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def convert_topology()
in onnxconverter_common/topology.py
101 46 6
def convert_float_to_float16()
in onnxconverter_common/float16.py
147 36 7
def is_same_node_merge()
in onnxconverter_common/optimizer.py
58 36 3
def apply()
in onnxconverter_common/optimizer.py
85 31 2
def find_local()
in onnxconverter_common/optimizer.py
88 31 1
def _resolve_duplicates()
in onnxconverter_common/topology.py
54 31 1
def apply_invoke_inline()
in onnxconverter_common/onnx_fx.py
66 28 4
def topological_operator_iterator()
in onnxconverter_common/topology.py
48 26 1
def apply_clip()
in onnxconverter_common/onnx_ops.py
74 25 7
def auto_convert_mixed_precision()
in onnxconverter_common/auto_mixed_precision.py
60 24 6
def make_model_ex()
in onnxconverter_common/onnx_ex.py
38 21 5
def find_push_down()
in onnxconverter_common/optimizer.py
21 19 1
def main()
in onnxconverter_common/perfstats.py
42 19 0
def find()
in onnxconverter_common/optimizer.py
35 18 1
def convert_to_list()
in onnxconverter_common/utils.py
24 18 1
def __getitem__()
in onnxconverter_common/onnx_fx.py
24 16 2
def generate()
in onnxconverter_common/optimizer.py
26 16 1
def calculate_linear_classifier_output_shapes()
in onnxconverter_common/shape_calculator.py
36 16 1
def is_eligible_concat_and_inner()
in onnxconverter_common/optimizer.py
23 15 1
def build_from_onnx()
in onnxconverter_common/optimizer.py
48 15 6