tensorflow / tflite-micro
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 3,006 units with 43,306 lines of code in units (65.6% of code).
    • 33 very long units (6,519 lines of code)
    • 127 long units (8,614 lines of code)
    • 384 medium size units (11,885 lines of code)
    • 408 small units (5,956 lines of code)
    • 2,054 very small units (10,332 lines of code)
15% | 19% | 27% | 13% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc17% | 24% | 34% | 12% | 11%
h13% | 15% | 17% | 13% | 40%
c11% | 0% | 45% | 24% | 18%
py0% | 16% | 35% | 27% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow/lite/micro15% | 25% | 32% | 12% | 14%
tensorflow/lite/schema24% | 0% | 4% | 13% | 58%
tensorflow/lite/core36% | 3% | 21% | 24% | 13%
tensorflow/lite/experimental11% | 0% | 49% | 19% | 18%
tensorflow/lite/kernels1% | 32% | 39% | 14% | 12%
tensorflow/lite/tools0% | 39% | 0% | 26% | 34%
tensorflow/lite/c0% | 0% | 18% | 57% | 24%
tensorflow/lite0% | 0% | 0% | 0% | 100%
tensorflow/lite/python0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
TfLiteStatus ParseOpDataTfLite()
in tensorflow/lite/core/api/flatbuffer_conversions.cc
660 185 5
inline void BuiltinOptionsUnion::Reset()
in tensorflow/lite/schema/schema_generated.h
587 117 0
inline bool VerifyBuiltinOptions()
in tensorflow/lite/schema/schema_generated.h
472 118 3
inline BuiltinOptionsUnion::BuiltinOptionsUnion()
in tensorflow/lite/schema/schema_generated.h
470 117 1
inline flatbuffers::Offset BuiltinOptionsUnion::Pack()
in tensorflow/lite/schema/schema_generated.h
469 117 2
TfLiteStatus PopulateQuantizedLstmParams8x8_16()
in tensorflow/lite/micro/kernels/xtensa/unidirectional_sequence_lstm.cc
289 15 3
TfLiteStatus EvalInteger8x8_16()
in tensorflow/lite/micro/kernels/xtensa/lstm_eval.cc
234 10 37
TfLiteStatus CheckInputTensorDimensions()
in tensorflow/lite/micro/kernels/xtensa/unidirectional_sequence_lstm.cc
216 33 7
TfLiteStatus Prepare()
in tensorflow/lite/micro/kernels/arc_mli/depthwise_conv.cc
159 13 2
TfLiteStatus Prepare()
in tensorflow/lite/micro/kernels/arc_mli/conv.cc
157 11 2
inline const BuiltinOperator()
in tensorflow/lite/schema/schema_generated.h
156 1 1
TfLiteStatus EvalMliQuantizedPerChannel()
in tensorflow/lite/micro/kernels/arc_mli/conv.cc
142 17 8
inline void LstmStepInteger8x8_16()
in tensorflow/lite/micro/kernels/xtensa/lstm_eval.cc
140 4 86
void calc_cell_state_without_cifg()
in tensorflow/lite/micro/kernels/xtensa/lstm_eval_hifi.cc
140 7 8
TfLiteStatus EvalMliQuantizedPerChannel()
in tensorflow/lite/micro/kernels/arc_mli/depthwise_conv.cc
140 15 8
void calc_cell_state_with_cifg()
in tensorflow/lite/micro/kernels/xtensa/lstm_eval_hifi.cc
137 7 7
TfLiteStatus Eval()
in tensorflow/lite/micro/kernels/xtensa/transpose_conv.cc
132 10 2
TfLiteStatus EvalInteger8x8_8()
in tensorflow/lite/micro/kernels/xtensa/lstm_eval.cc
128 4 35
TfLiteStatus EvalMliQuantizedInt8()
in tensorflow/lite/micro/kernels/arc_mli/fully_connected.cc
127 15 8
TfLiteStatus Eval()
in tensorflow/lite/micro/kernels/xtensa/unidirectional_sequence_lstm.cc
122 4 2