microsoft / Windows-Driver-Frameworks
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 64 units with 665 lines of code in units (0.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (133 lines of code)
    • 13 small units (189 lines of code)
    • 47 very small units (343 lines of code)
0% | 0% | 20% | 28% | 51%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 0% | 35% | 36% | 28%
hpp0% | 0% | 22% | 36% | 40%
h0% | 0% | 0% | 11% | 88%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/framework/shared/core0% | 0% | 42% | 30% | 27%
src/framework/shared/inc0% | 0% | 18% | 39% | 42%
src/framework/shared/support0% | 0% | 100% | 0% | 0%
src/framework/umdf/fxlib0% | 0% | 0% | 100% | 0%
src/framework/shared/targets0% | 0% | 0% | 100% | 0%
src/framework/shared/object0% | 0% | 0% | 61% | 38%
src/framework/kmdf/src0% | 0% | 0% | 100% | 0%
src/publicinc/wdf/kmdf0% | 0% | 0% | 0% | 100%
src/publicinc/wdf/umdf0% | 0% | 0% | 0% | 100%
src/framework/shared/enhancedverif0% | 0% | 0% | 0% | 100%
src/framework/shared/irphandlers0% | 0% | 0% | 0% | 100%
src/framework/kmdf/inc0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
class DECLSPEC_ALIGN()
in src/framework/shared/inc/private/common/fxsyncrequest.hpp
45 2 1
__in __drv_strictTypeMatch()
in src/framework/shared/support/fxresourcecollection.cpp
35 4 1
FxMemoryBufferFromLookaside::operator new()
in src/framework/shared/core/fxmemorybufferfromlookaside.cpp
27 2 5
_Pre_notnull_ _Pre_writable_byte_size_()
in src/framework/shared/core/fxmemorybufferpreallocatedapi.cpp
26 2 1
FxMemoryBufferFromPoolLookaside::operator new()
in src/framework/shared/core/fxmemorybufferfromlookaside.cpp
19 1 4
_Pre_notnull_ _Pre_writable_byte_size_()
in src/framework/shared/core/fxrequestmemory.cpp
19 2 1
operator new()
in src/framework/shared/inc/private/common/fxmemorybuffer.hpp
18 1 6
WINAPI DllMain()
in src/framework/umdf/fxlib/version/framework.cpp
18 3 3
operator new()
in src/framework/shared/inc/private/common/fxobject.hpp
15 1 3
operator new()
in src/framework/shared/inc/private/common/fxobject.hpp
15 1 4
_Post_ _At_()
in src/framework/shared/inc/primitives/um/mxgeneralum.h
13 1 3
__out __drv_deref()
in src/framework/shared/inc/private/common/fxnonpagedobject.hpp
13 3 1
operator new()
in src/framework/shared/inc/private/common/fxobject.hpp
13 1 2
FxUsbPipeContinuousReader::operator new()
in src/framework/shared/targets/usb/fxusbpipe.cpp
13 1 4
FxDeviceDescriptionEntry::operator new()
in src/framework/kmdf/src/core/fxchildlist.cpp
11 1 3
_Post_ _At_()
in src/framework/shared/inc/primitives/km/mxgeneralkm.h
11 1 3
__in __drv_when()
in src/framework/shared/object/fxobjectstatemachine.cpp
11 2 2
_Pre_notnull_ _Pre_writable_byte_size_()
in src/framework/shared/enhancedverif/km/vfwdfdynamics.cpp
10 1 1
_Pre_notnull_ _Pre_writable_byte_size_()
in src/framework/shared/enhancedverif/um/vfwdfdynamics.cpp
10 1 1
FxRequestFromLookaside::operator new()
in src/framework/shared/core/fxrequest.cpp
9 1 3