microsoft / wil
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,271 units with 8,880 lines of code in units (34.2% of code).
    • 1 very long units (101 lines of code)
    • 8 long units (622 lines of code)
    • 43 medium size units (1,240 lines of code)
    • 125 small units (1,720 lines of code)
    • 1,094 very small units (5,197 lines of code)
1% | 7% | 13% | 19% | 58%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h1% | 7% | 13% | 19% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
include/wil1% | 7% | 13% | 19% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
inline HRESULT GetFailureLogString()
in include/wil/result_macros.h
101 23 1
inline void LogFailure()
in include/wil/result_macros.h
95 25 6
89 16 1
void Flush()
in include/wil/Tracelogging.h
81 13 1
79 14 2
inline HRESULT ResultFromKnownExceptions()
in include/wil/result_macros.h
78 22 4
72 15 4
68 12 1
HRESULT WaitForCompletion()
in include/wil/winrt.h
60 7 4
46 11 0
40 11 1
static STRSAFEAPI WilStringVPrintfWorkerA()
in include/wil/result_macros.h
40 5 1
39 9 1
inline HRESULT GetFileInfo()
in include/wil/filesystem.h
38 6 4
void SetFailureInfo()
in include/wil/result_macros.h
36 5 1
static bool GetThreadContext()
in include/wil/result.h
35 7 3
void Set()
in include/wil/result.h
34 5 2
bool GetLastError()
in include/wil/result.h
34 10 3
HRESULT RunWhenComplete()
in include/wil/winrt.h
33 5 2
31 7 1