tensorflow / tensorflow
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 86,666 units with 1,279,852 lines of code in units (61.1% of code).
    • 1,006 very long units (182,114 lines of code)
    • 3,250 long units (220,947 lines of code)
    • 11,206 medium size units (350,359 lines of code)
    • 18,961 small units (275,738 lines of code)
    • 52,243 very small units (250,694 lines of code)
14% | 17% | 27% | 21% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc17% | 21% | 31% | 16% | 12%
h23% | 13% | 18% | 13% | 31%
py5% | 14% | 32% | 22% | 25%
mm23% | 15% | 43% | 11% | 6%
go<1% | 1% | 8% | 63% | 25%
c19% | 0% | 39% | 23% | 17%
inc<1% | <1% | 4% | 58% | 37%
java0% | 2% | 19% | 23% | 54%
swift0% | 0% | 50% | 33% | 16%
cpp0% | 0% | 0% | 21% | 78%
pyi0% | 0% | 0% | 3% | 96%
pyx0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow/lite26% | 18% | 27% | 13% | 13%
tensorflow/compiler17% | 21% | 30% | 15% | 14%
tensorflow/core13% | 21% | 30% | 17% | 16%
tensorflow/python4% | 14% | 31% | 22% | 26%
tensorflow/stream_executor3% | 2% | 7% | 51% | 34%
tensorflow/tools27% | 21% | 26% | 13% | 11%
tensorflow/c4% | 9% | 29% | 27% | 29%
tensorflow/go<1% | 1% | 8% | 63% | 25%
ROOT15% | 23% | 26% | 22% | 11%
tensorflow/cc1% | 12% | 33% | 22% | 29%
tensorflow/java0% | 7% | 23% | 23% | 46%
tensorflow/distribute0% | 14% | 42% | 27% | 16%
tensorflow/security0% | 0% | 39% | 24% | 36%
tensorflow/js0% | 0% | 61% | 18% | 20%
tensorflow0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
port::Status CUDABlas::DoBlasInternalImpl()
in tensorflow/stream_executor/cuda/cuda_blas.cc
2850 160 5
bool HloParserImpl::ParseInstructionRhs()
in tensorflow/compiler/xla/service/hlo_parser.cc
1763 405 4
def __init__()
in tensorflow/tools/compatibility/tf_upgrade_v2.py
1456 16 3
bool NNAPIDelegateKernel::Validate()
in tensorflow/lite/delegates/nnapi/nnapi_delegate.cc
1201 214 7
StatusOr PartitionBaseCase()
in tensorflow/compiler/xla/service/spmd/dot_handler.cc
1053 184 10
std::string HloDotDumper::Header()
in tensorflow/compiler/xla/service/hlo_graph_dumper.cc
1047 308 0
OperatorProperty GetOperatorProperty()
in tensorflow/lite/tools/optimize/operator_property.cc
927 102 1
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h
918 1 9
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv_hybrid_3x3_filter.h
856 1 11
StatusOr HloFunctionImporter::ImportInstructionImpl()
in tensorflow/compiler/mlir/xla/hlo_function_importer.cc
838 99 4
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h
827 1 9
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv_3x3_filter.h
826 1 11
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h
808 1 9
inline void ResizeBilinear888Uint8()
in tensorflow/lite/kernels/internal/optimized/resize_bilinear.h
800 33 6
TfLiteStatus NNAPIDelegateKernel::Map()
in tensorflow/lite/delegates/nnapi/nnapi_delegate.cc
787 126 7
static inline void KernelMacroBlockNeon()
in tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h
760 1 5
static inline void Run()
in tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv_hybrid_3x3_filter.h
760 1 11
return errors::Unimplemented()
in tensorflow/core/debug/debug_io_utils.cc
751 90 2
std::string ConvPowerVR::GenerateConv()
in tensorflow/lite/delegates/gpu/common/tasks/conv_powervr.cc
749 178 4
static inline void KernelMacroBlockNeon()
in tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h
748 1 5