tensorflow / rust
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 4,250 units with 60,434 lines of code in units (37.7% of code).
    • 15 very long units (1,814 lines of code)
    • 88 long units (5,529 lines of code)
    • 1,089 medium size units (30,733 lines of code)
    • 875 small units (14,036 lines of code)
    • 2,183 very small units (8,322 lines of code)
3% | 9% | 50% | 23% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs3% | 9% | 50% | 23% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/protos5% | 15% | 29% | 16% | 33%
tensorflow-op-codegen/src6% | 22% | 31% | 15% | 24%
src8% | 6% | 19% | 29% | 36%
tensorflow-proto-codegen/src100% | 0% | 0% | 0% | 0%
tensorflow-sys29% | 22% | 23% | 14% | 10%
src/ops0% | 4% | 67% | 27% | <1%
tensorflow-sys/src0% | 41% | 58% | 0% | 0%
tensorflow-internal-macros/src0% | 0% | 67% | 20% | 11%
src/eager0% | 0% | 21% | 47% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn descriptor_static()
in src/protos/rewriter_config.rs
176 2 0
fn main()
in tensorflow-proto-codegen/src/main.rs
160 1 0
fn merge_from()
in src/protos/rewriter_config.rs
138 9 2
fn main()
in tensorflow-op-codegen/src/main.rs
125 4 0
fn merge_from()
in src/protos/config.rs
124 16 2
118 1 0
fn write_to_with_cached_sizes()
in src/protos/rewriter_config.rs
113 34 2
fn write_to_with_cached_sizes()
in tensorflow-op-codegen/src/protos/tensor.rs
111 28 2
fn write_to_with_cached_sizes()
in src/protos/tensor.rs
111 28 2
fn build_from_src()
in tensorflow-sys/build.rs
110 11 0
fn compute_size()
in src/protos/rewriter_config.rs
110 34 1
fn merge_from()
in src/protos/step_stats.rs
106 13 2
fn descriptor_static()
in src/protos/config.rs
106 2 0
fn merge_from()
in src/protos/cost_graph.rs
103 13 2
fn xor_nn()
in src/train.rs
103 5 0
fn merge_from()
in src/protos/config.rs
98 11 2
fn descriptor_static()
in tensorflow-op-codegen/src/protos/tensor.rs
96 2 0
fn descriptor_static()
in src/protos/step_stats.rs
96 2 0
fn descriptor_static()
in src/protos/config.rs
96 2 0
fn descriptor_static()
in src/protos/tensor.rs
96 2 0