microsoft / diskspd-for-linux
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 125 units with 1,907 lines of code in units (57.8% of code).
    • 4 very long units (851 lines of code)
    • 2 long units (152 lines of code)
    • 11 medium size units (302 lines of code)
    • 22 small units (323 lines of code)
    • 86 very small units (279 lines of code)
44% | 7% | 15% | 16% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc51% | 9% | 18% | 12% | 9%
h0% | 0% | 0% | 48% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src44% | 7% | 15% | 16% | 14%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool Job::run_job()
in src/job.cc
237 47 0
235 56 2
192 34 1
187 40 0
void ResultFormatterText::print_iops()
in src/result_formatter.cc
86 20 2
66 12 1
int submit()
in src/kernel_aio.cc
36 6 1
34 10 1
30 5 2
29 12 2
int submit()
in src/posix_aio.cc
28 6 1
std::shared_ptr wait()
in src/posix_aio.cc
26 5 1
26 4 1
25 5 1
24 8 1
std::shared_ptr wait()
in src/kernel_aio.cc
23 4 1
21 3 1
bool create_group()
in src/posix_aio.cc
20 4 2
bool create_group()
in src/kernel_aio.cc
19 3 2
bool arg_to_number()
in src/options.h
19 6 3