microsoft / ADBench
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,584 units with 19,854 lines of code in units (16.7% of code).
    • 6 very long units (1,187 lines of code)
    • 52 long units (3,359 lines of code)
    • 216 medium size units (6,562 lines of code)
    • 292 small units (4,380 lines of code)
    • 1,018 very small units (4,366 lines of code)
5% | 16% | 33% | 22% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cxx95% | 0% | 4% | 0% | 0%
jl7% | 5% | 26% | 30% | 28%
cpp2% | 30% | 42% | 14% | 10%
cs14% | 14% | 32% | 14% | 24%
c0% | 28% | 34% | 18% | 18%
py0% | 4% | 26% | 35% | 33%
h0% | 3% | 42% | 38% | 15%
m0% | 0% | 4% | 0% | 95%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tools18% | 11% | 27% | 24% | 18%
src1% | 20% | 36% | 22% | 18%
usr31% | 0% | 19% | 22% | 25%
ADBench0% | 19% | 32% | 13% | 33%
submodules0% | 0% | 4% | 0% | 95%
data0% | 0% | 37% | 26% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
cxx
void mlx_function()
in tools/MuPad/mupad_ba_compute_reproj_err_mex.cxx
382 5 2
cxx
void mlx_function()
in tools/MuPad/example_gmm_objective_mex_d2_K5.cxx
256 5 2
cxx
void mlx_function()
in tools/MuPad/example_gmm_objective_mex_d2_K3.cxx
174 5 2
jl
function awfrdiff()
in usr/awf/Julia/awfrdiff.jl
145 32 6
void lstm_predict_d()
in src/cpp/modules/manual/lstm_d.cpp
117 8 11
public string ToJsonString()
in src/dotnet/utils/JacobianComparisonLib/JacobianComparison.cs
113 13 0
void gmm_objective_b()
in src/cpp/modules/tapenade/gmm/gmm_b.c
99 12 13
void gmm_objective_b()
in src/cpp/modules/tapenade/gmm/gmm_b_tapenade_generated.c
98 10 13
def generate_graph()
in ADBench/plot_graphs.py
96 20 4
void read_hand_model()
in src/cpp/shared/utils.cpp
93 16 2
void read_hand_model()
in src/cpp/shared/utils.cpp
92 15 2
void TapenadeHand::calculate_jacobian_complicated()
in src/cpp/modules/tapenade/TapenadeHand.cpp
83 8 0
void rodrigues_rotate_point_b()
in src/cpp/modules/tapenade/ba/ba_b.c
79 12 6
void lstm_model_b()
in src/cpp/modules/tapenade/lstm/lstm_b.c
79 7 11
void lstm_model_b()
in src/cpp/modules/tapenade/lstm/lstm_b_tapenade_generated.c
79 7 11
double compute_ba_J()
in tools/ADOLC/main.cpp
78 9 14
void rodrigues_rotate_point_b()
in src/cpp/modules/tapenade/ba/ba_b_tapenade_generated.c
77 10 6
double compute_hand_J()
in tools/ADOLC/main.cpp
76 18 7
void read_hand_model()
in tools/Adept/utils_vxl.h
75 12 2
void gmm_objective_d()
in src/cpp/modules/manual/gmm_d.cpp
74 9 10