tensorflow / tfx-bsl
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 733 units with 7,807 lines of code in units (69.3% of code).
    • 5 very long units (649 lines of code)
    • 11 long units (720 lines of code)
    • 74 medium size units (2,226 lines of code)
    • 133 small units (1,945 lines of code)
    • 510 very small units (2,267 lines of code)
8% | 9% | 28% | 24% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc15% | 14% | 29% | 18% | 22%
py0% | 2% | 28% | 31% | 37%
h0% | 11% | 21% | 35% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tfx_bsl/cc14% | 13% | 28% | 19% | 22%
tfx_bsl/tfxio0% | 4% | 23% | 34% | 37%
tfx_bsl/beam0% | 0% | 47% | 21% | 30%
tfx_bsl/coders0% | 0% | 31% | 38% | 30%
tfx_bsl/arrow0% | 0% | 0% | 37% | 62%
tfx_bsl/tools0% | 0% | 0% | 64% | 35%
ROOT0% | 0% | 0% | 0% | 100%
tfx_bsl/types0% | 0% | 0% | 0% | 100%
tfx_bsl/statistics0% | 0% | 0% | 0% | 100%
tfx_bsl/telemetry0% | 0% | 0% | 0% | 100%
tfx_bsl/public0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void DefineArrayUtilSubmodule()
in tfx_bsl/cc/arrow/arrow_submodule.cc
164 8 1
void DefineQuantilesSketchClass()
in tfx_bsl/cc/sketches/sketches_submodule.cc
129 9 1
void DefineCodersSubmodule()
in tfx_bsl/cc/coders/coders_submodule.cc
128 12 1
116 32 1
void DefineMisraGriesSketchClass()
in tfx_bsl/cc/sketches/sketches_submodule.cc
112 8 1
def GetTensor()
in tfx_bsl/tfxio/tensor_adapter.py
94 28 3
absl::Status SequenceExamplesToRecordBatchDecoder::Make()
in tfx_bsl/cc/coders/example_decoder.cc
72 10 3
void DefineKmvSketchClass()
in tfx_bsl/cc/sketches/sketches_submodule.cc
69 5 1
absl::Status CooFromListArray()
in tfx_bsl/cc/arrow/array_util.cc
68 8 3
void DefineTableUtilSubmodule()
in tfx_bsl/cc/arrow/arrow_submodule.cc
68 4 1
absl::Status PromoteArrayDataToType()
in tfx_bsl/cc/arrow/table_util.cc
67 9 3
absl::Status ExampleToNumpyDict()
in tfx_bsl/cc/coders/example_numpy_decoder.cc
63 10 2
57 14 5
static absl::Status Deserialize()
in tfx_bsl/cc/sketches/quantiles_sketch.cc
55 7 2
55 6 1
void Merge()
in tfx_bsl/cc/sketches/weighted_quantiles_summary.h
52 9 1
absl::Status MisraGriesSketch::GetCounts()
in tfx_bsl/cc/sketches/misragries_sketch.cc
50 13 1
absl::Status RecordBatchToExamples()
in tfx_bsl/cc/coders/example_encoder.cc
50 8 3
def _post_process()
in tfx_bsl/beam/run_inference.py
49 12 6
absl::Status DecodeTopLevelFeatures()
in tfx_bsl/cc/coders/example_decoder.cc
49 13 4