tensorflow / tflite-support
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,824 units with 20,822 lines of code in units (57.2% of code).
    • 8 very long units (961 lines of code)
    • 36 long units (2,486 lines of code)
    • 204 medium size units (6,108 lines of code)
    • 342 small units (4,983 lines of code)
    • 1,234 very small units (6,284 lines of code)
4% | 11% | 29% | 23% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc9% | 22% | 40% | 15% | 12%
java0% | 1% | 14% | 34% | 50%
py0% | 4% | 39% | 21% | 34%
h0% | 8% | 18% | 25% | 47%
mm0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cc9% | 22% | 35% | 17% | 15%
codegen24% | 21% | 30% | 13% | 9%
custom_ops0% | 23% | 53% | 11% | 10%
metadata0% | 5% | 23% | 26% | 44%
java0% | 1% | 19% | 35% | 43%
odml0% | 0% | 25% | 14% | 59%
c0% | 0% | 51% | 11% | 36%
ios0% | 0% | 97% | 0% | 2%
tools0% | 0% | 34% | 0% | 65%
acceleration0% | 0% | 0% | 59% | 40%
python0% | 0% | 0% | 24% | 75%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool GenerateWrapperAPI()
in tensorflow_lite_support/codegen/android_java_generator.cc
152 19 3
absl::Status ClassificationPostprocessor::Init()
in tensorflow_lite_support/cc/task/processor/classification_postprocessor.cc
142 29 1
bool GenerateWrapperMetadata()
in tensorflow_lite_support/codegen/android_java_generator.cc
139 19 3
absl::Status ImageClassifier::CheckAndSetOutputs()
in tensorflow_lite_support/cc/task/vision/image_classifier.cc
116 20 0
absl::Status UniformCropResizeYuv()
in tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc
106 14 3
absl::Status ConvertFromYv()
in tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc
103 12 2
absl::Status DecodeLin16WaveAsFloatVector()
in tensorflow_lite_support/cc/task/audio/utils/wav_io.cc
102 15 5
absl::Status ImagePreprocessor::Preprocess()
in tensorflow_lite_support/cc/task/processor/image_preprocessor.cc
101 16 2
StatusOr BuildInputImageTensorSpecs()
in tensorflow_lite_support/cc/task/vision/utils/image_tensor_specs.cc
98 16 2
absl::Status ExternalFileHandler::MapExternalFile()
in tensorflow_lite_support/cc/task/core/external_file_handler.cc
93 17 0
StatusOr ImageClassifier::Postprocess()
in tensorflow_lite_support/cc/task/vision/image_classifier.cc
91 20 3
absl::Status ConvertFromRgba()
in tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc
91 12 2
absl::Status BertQuestionAnswerer::Preprocess()
in tensorflow_lite_support/cc/task/text/bert_question_answerer.cc
88 13 3
bool GenerateWrapperOutputs()
in tensorflow_lite_support/codegen/android_java_generator.cc
84 11 3
absl::Status ConvertFromNv21()
in tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc
84 10 2
absl::Status ObjectDetector::CheckAndSetOutputs()
in tensorflow_lite_support/cc/task/vision/object_detector.cc
82 12 0
absl::Status ConvertFromNv12()
in tensorflow_lite_support/cc/task/vision/utils/libyuv_frame_buffer_utils.cc
81 10 2
StatusOr ImageSegmenter::Postprocess()
in tensorflow_lite_support/cc/task/vision/image_segmenter.cc
80 13 3
tflite::support::StatusOr ConvertSentencepieceModelToFlatBuffer()
in tensorflow_lite_support/custom_ops/kernel/sentencepiece/model_converter.cc
73 8 2
def create_from_metadata_info()
in tensorflow_lite_support/metadata/python/metadata_writers/object_detector.py
73 15 10