microsoft / SymCrypt
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 399 units with 7,335 lines of code in units (8.2% of code).
    • 4 very long units (709 lines of code)
    • 22 long units (1,569 lines of code)
    • 92 medium size units (2,812 lines of code)
    • 76 small units (1,106 lines of code)
    • 205 very small units (1,139 lines of code)
9% | 21% | 38% | 15% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp12% | 22% | 36% | 14% | 13%
cs0% | 36% | 35% | 13% | 14%
py0% | 9% | 39% | 27% | 23%
c0% | 0% | 71% | 0% | 28%
h0% | 0% | 41% | 25% | 32%
mm0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
unittest12% | 21% | 37% | 14% | 13%
scbuild0% | 36% | 35% | 13% | 14%
scripts0% | 9% | 39% | 27% | 23%
module0% | 0% | 94% | 0% | 5%
inc0% | 0% | 55% | 0% | 45%
lib0% | 0% | 0% | 0% | 100%
gen0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
VOID testDlSimple()
in unittest/lib/testDh.cpp
240 10 0
VOID testDlSimple()
in unittest/lib/testDl.cpp
232 6 0
VOID generateDlGroups()
in unittest/lib/testDh.cpp
125 16 0
112 2 1
VOID measurePerfOneAlg()
in unittest/lib/perf.cpp
97 18 1
93 3 1
template VOID algImpTestInteropGenerateKeyEntry()
in unittest/lib/testDl_msbignum.cpp
89 3 1
NTSTATUS BlockCipherImp::setKey()
in unittest/lib/cng_imp_blockcipherpattern.cpp
86 9 1
VOID measurePerfData()
in unittest/lib/perf.cpp
86 9 7
void UpdateVersionNumber()
in scbuild/scbuild.cs
85 16 0
VOID testRsaRunAlgs()
in unittest/lib/old-testRsa.cpp
84 15 0
80 1 1
double measureDataPerfGivenStack()
in unittest/lib/perf.cpp
78 13 7
72 2 1
VOID testDlRunAlgs()
in unittest/lib/testDl.cpp
70 8 0
VOID rsaTestKeysGenerate()
in unittest/lib/testRsaSign.cpp
70 12 0
VOID printDlGroup()
in unittest/lib/testDl.cpp
68 3 1
public bool ProcessOptions()
in scbuild/scbuild.cs
62 14 1
VOID BlockCipherImp::encrypt()
in unittest/lib/capi_imp_blockcipherpattern.cpp
59 8 1
double measureKeyPerfGivenStack()
in unittest/lib/perf.cpp
59 8 4