microsoft / onnxconverter-common
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 560 units with 5,530 lines of code in units (92.3% of code).
    • 2 very long units (248 lines of code)
    • 7 long units (485 lines of code)
    • 67 medium size units (1,911 lines of code)
    • 90 small units (1,325 lines of code)
    • 394 very small units (1,561 lines of code)
4% | 8% | 34% | 23% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 8% | 34% | 23% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
onnxconverter_common4% | 8% | 34% | 24% | 27%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def convert_float_to_float16()
in onnxconverter_common/float16.py
147 36 7
def convert_topology()
in onnxconverter_common/topology.py
101 46 6
def find_local()
in onnxconverter_common/optimizer.py
88 31 1
def apply()
in onnxconverter_common/optimizer.py
85 31 2
def apply_clip()
in onnxconverter_common/onnx_ops.py
74 25 7
def apply_invoke_inline()
in onnxconverter_common/onnx_fx.py
66 28 4
def auto_convert_mixed_precision()
in onnxconverter_common/auto_mixed_precision.py
60 24 6
def is_same_node_merge()
in onnxconverter_common/optimizer.py
58 36 3
def _resolve_duplicates()
in onnxconverter_common/topology.py
54 31 1
def apply_slice()
in onnxconverter_common/onnx_ops.py
50 12 9
def build_from_onnx()
in onnxconverter_common/optimizer.py
48 15 6
def topological_operator_iterator()
in onnxconverter_common/topology.py
48 26 1
def convert()
in onnxconverter_common/onnx2py.py
45 9 2
def main()
in onnxconverter_common/perfstats.py
42 19 0
def check_input_and_output_numbers()
in onnxconverter_common/utils.py
41 15 3
def apply()
in onnxconverter_common/optimizer.py
40 10 2
def apply()
in onnxconverter_common/optimizer.py
39 8 2
def make_model_ex()
in onnxconverter_common/onnx_ex.py
38 21 5
def calculate_linear_classifier_output_shapes()
in onnxconverter_common/shape_calculator.py
36 16 1
def find()
in onnxconverter_common/optimizer.py
35 18 1