facebookresearch / gad
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 285 units with 1,824 lines of code in units (56.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 12 medium size units (322 lines of code)
    • 37 small units (556 lines of code)
    • 236 very small units (946 lines of code)
0% | 0% | 17% | 30% | 51%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 0% | 17% | 30% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gad/src0% | 0% | 17% | 30% | 51%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn select_argmax()
in gad/src/compare.rs
44 5 5
35 7 4
fn do_compute_gradients()
in gad/src/graph.rs
34 7 4
fn matmul()
in gad/src/matrix.rs
29 6 5
fn matmul()
in gad/src/matrix.rs
27 3 5
fn div()
in gad/src/analytic.rs
24 3 3
fn softmax_as()
in gad/src/array_compare.rs
23 2 3
fn apply_gradient_step()
in gad/src/net_ext.rs
22 4 3
fn select_argmax()
in gad/src/compare.rs
21 1 5
fn scale()
in gad/src/array.rs
21 3 3
fn dot()
in gad/src/array.rs
21 3 3
fn mul()
in gad/src/arith.rs
21 3 3
fn from()
in gad/src/matrix.rs
20 1 1
fn add_all()
in gad/src/core.rs
18 3 2
fn exp()
in gad/src/analytic.rs
18 1 2
fn tanh()
in gad/src/analytic.rs
18 2 2
fn sigmoid()
in gad/src/analytic.rs
18 2 2
fn sub()
in gad/src/arith.rs
18 3 3
fn add()
in gad/src/core.rs
17 3 3
fn max_as()
in gad/src/array_compare.rs
17 2 3