microsoft / IIS.Common
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 179 units with 3,171 lines of code in units (16.0% of code).
    • 4 very long units (736 lines of code)
    • 8 long units (544 lines of code)
    • 31 medium size units (903 lines of code)
    • 29 small units (451 lines of code)
    • 107 very small units (537 lines of code)
23% | 17% | 28% | 14% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h36% | 13% | 21% | 15% | 12%
cs0% | 17% | 47% | 14% | 20%
cxx0% | 57% | 30% | 5% | 6%
hxx0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Include35% | 13% | 21% | 13% | 15%
lib0% | 57% | 30% | 5% | 6%
Managed/NativeMethods0% | 33% | 38% | 4% | 23%
Managed/PseudoLoc0% | 20% | 52% | 7% | 20%
Managed/Util0% | 0% | 51% | 30% | 17%
reftrace/include0% | 0% | 0% | 62% | 37%
open-inc0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
class __declspec()
in Include/httpserv_xp.h
236 1 1
class __declspec()
in Include/httpserv_xp.h
188 1 1
class __declspec()
in Include/httpserv_xp.h
158 1 1
class __declspec()
in Include/httpserv_xp.h
154 1 1
internal static extern bool AdjustTokenPrivileges()
in Managed/NativeMethods/AdvApi32.cs
85 4 2
class __declspec()
in Include/httpserv_xp.h
76 1 1
cxx
STRA name()
in lib/normalize.cxx
76 12 2
class __declspec()
in Include/httpserv_xp.h
75 1 1
class __declspec()
in Include/httpserv_xp.h
61 1 1
class __declspec()
in Include/httpserv_xp.h
60 1 1
private static Dictionary CreateTranslationsMap()
in Managed/PseudoLoc/PseudoLocalizer.cs
59 1 0
cxx
BOOL IsUTF8URL()
in lib/normalize.cxx
52 13 1
int SetProperty()
in Managed/NativeMethods/Fusion.cs
43 1 3
class __declspec()
in Include/httpserv_xp.h
40 1 1
class __declspec()
in Include/httpserv_xp.h
40 1 1
class __declspec()
in Include/httpserv_xp.h
35 1 1
public static bool IsLocalMachine()
in Managed/Util/WebUtility.cs
35 9 2
cxx
BOOL MULTISZ::AuxAppend()
in lib/multisz.cxx
35 7 3
class __declspec()
in Include/httpserv_xp.h
34 1 1
class __declspec()
in Include/httpserv_xp.h
34 1 1