microsoft / MMdnn
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 1,438 units with 14,156 lines of code in units (81.5% of code).
    • 3 very long units (582 lines of code)
    • 23 long units (1,465 lines of code)
    • 134 medium size units (3,925 lines of code)
    • 241 small units (3,478 lines of code)
    • 1,037 very small units (4,706 lines of code)
4% | 10% | 27% | 24% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 10% | 27% | 24% | 33%
tsx0% | 0% | 40% | 18% | 40%
ts0% | 0% | 63% | 26% | 9%
js0% | 0% | 0% | 65% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mmdnn/conversion/darknet53% | 7% | 13% | 10% | 15%
mmdnn/conversion/coreml8% | 17% | 43% | 16% | 13%
mmdnn/conversion/mxnet0% | 22% | 22% | 20% | 34%
mmdnn/conversion/tensorflow0% | 11% | 18% | 34% | 35%
mmdnn/conversion/onnx0% | 28% | 28% | 19% | 22%
mmdnn/conversion/_script0% | 26% | 62% | 0% | 11%
mmdnn/conversion/keras0% | 4% | 22% | 30% | 42%
mmdnn/conversion/rewriter0% | 12% | 37% | 23% | 26%
mmdnn/conversion/pytorch0% | 4% | 26% | 34% | 34%
mmdnn/conversion/paddle0% | 16% | 47% | 4% | 31%
mmdnn/conversion/caffe0% | 0% | 32% | 25% | 41%
mmdnn/conversion/cntk0% | 0% | 21% | 30% | 48%
mmdnn/vis_edit/src0% | 0% | 44% | 19% | 35%
mmdnn/conversion/common0% | 0% | 19% | 17% | 62%
mmdnn/conversion/torch0% | 0% | 32% | 31% | 36%
mmdnn/models0% | 0% | 0% | 52% | 47%
mmdnn/visualization0% | 0% | 0% | 65% | 34%
mmdnn/visualization/public0% | 0% | 0% | 65% | 34%
requirements0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build()
in mmdnn/conversion/darknet/darknet_graph.py
356 54 1
def print_cfg_nicely()
in mmdnn/conversion/darknet/cfg.py
120 20 1
def _convert_padding()
in mmdnn/conversion/coreml/coreml_parser.py
106 22 2
def _convert()
in mmdnn/conversion/_script/convertToIR.py
97 31 1
def emit_Scale()
in mmdnn/conversion/onnx/onnx_emitter.py
87 4 2
def emit_BatchNorm()
in mmdnn/conversion/onnx/onnx_emitter.py
85 3 2
def _emit_convolution()
in mmdnn/conversion/mxnet/mxnet_emitter.py
78 20 3
def emit_Conv()
in mmdnn/conversion/onnx/onnx_emitter.py
73 3 2
def gen_code()
in mmdnn/conversion/mxnet/mxnet_emitter.py
71 26 2
def _convert_layers_batchnorm()
in mmdnn/conversion/tensorflow/tensorflow_frozenparser.py
68 7 2
def parse_prototxt()
in mmdnn/conversion/darknet/prototxt.py
67 10 1
def __init__()
in mmdnn/conversion/tensorflow/tensorflow_parser.py
66 20 6
def emit_Pool()
in mmdnn/conversion/keras/keras2_emitter.py
64 18 3
def rename_Convolution()
in mmdnn/conversion/mxnet/mxnet_parser.py
58 15 2
def __init__()
in mmdnn/conversion/tensorflow/tensorflow_frozenparser.py
58 8 5
def _rebuild_scope_edges_and_get_ret_vars()
in mmdnn/conversion/rewriter/folder.py
57 10 2
def emit_Pool()
in mmdnn/conversion/coreml/coreml_emitter.py
56 6 2
def emit_Pool()
in mmdnn/conversion/tensorflow/tensorflow_emitter.py
56 17 2
def gen_model()
in mmdnn/conversion/coreml/coreml_emitter.py
55 10 13
def build()
in mmdnn/conversion/coreml/coreml_graph.py
54 41 1