microsoft / omi
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 4,631 units with 109,254 lines of code in units (57.9% of code).
    • 173 very long units (30,081 lines of code)
    • 310 long units (21,826 lines of code)
    • 788 medium size units (25,174 lines of code)
    • 1,460 small units (20,356 lines of code)
    • 1,900 very small units (11,817 lines of code)
27% | 19% | 23% | 18% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c32% | 23% | 24% | 12% | 6%
cpp24% | 22% | 27% | 15% | 10%
inc97% | 0% | 0% | 2% | 0%
h0% | 0% | 7% | 56% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Unix/wsman42% | 20% | 24% | 9% | 3%
Unix/codec44% | 19% | 20% | 10% | 5%
Unix/http49% | 24% | 18% | 5% | 2%
Unix/miapi30% | 32% | 20% | 11% | 4%
Unix/base17% | 19% | 23% | 22% | 17%
Unix/xmlserializer46% | 27% | 19% | 5% | 1%
Unix/gen35% | 18% | 24% | 11% | 9%
Unix/mof40% | 17% | 24% | 14% | 2%
Unix/xml40% | 19% | 18% | 14% | 7%
Unix/micxx34% | 2% | 5% | 24% | 33%
Unix/cli42% | 20% | 33% | 1% | 2%
Unix/wql64% | 8% | 16% | 6% | 5%
Unix/scriptext75% | 6% | 11% | 1% | 4%
Unix/disp31% | 20% | 22% | 12% | 11%
Unix/server37% | 19% | 35% | 6% | 1%
Unix/nits13% | 17% | 28% | 20% | 20%
Unix/indication25% | 26% | 8% | 25% | 14%
Unix/protocol13% | 34% | 37% | 9% | 5%
Unix/sock16% | 18% | 43% | 14% | 7%
Unix/configeditor83% | 0% | 7% | 3% | 5%
Unix/provmgr4% | 16% | 27% | 32% | 19%
Unix/provreg25% | 25% | 27% | 18% | 2%
Unix/oi12% | 34% | 25% | 13% | 14%
Unix/omiutils7% | 0% | 2% | 53% | 36%
Unix/omireg20% | 24% | 37% | 9% | 7%
Unix/omiclient0% | 29% | 45% | 14% | 10%
Unix/pal0% | 9% | 30% | 30% | 29%
Unix/strhash0% | 71% | 14% | 14% | 0%
Unix/tools0% | 34% | 47% | 16% | 1%
Unix/scripts0% | 75% | 21% | 3% | 0%
Unix/deprecated0% | 17% | 31% | 21% | 29%
Unix/agent0% | 44% | 36% | 5% | 13%
Unix/ut0% | 34% | 10% | 23% | 30%
Unix/omi_error0% | 8% | 13% | 49% | 28%
Unix/engine0% | 90% | 0% | 0% | 9%
Unix/check0% | 32% | 50% | 0% | 17%
Unix/providers0% | 7% | 2% | 57% | 32%
Unix/common0% | 0% | 12% | 86% | 1%
Unix/image0% | 0% | 100% | 0% | 0%
Unix/chkshlib0% | 0% | 0% | 100% | 0%
Unix/midll0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool DInstance::DynamicToStatic()
in Unix/micxx/dinstance.cpp
641 152 4
int InitializerToValue()
in Unix/codec/mof/parser/types.c
533 92 4
int HashStr()
in Unix/wsman/wstags_quick.inc
522 261 3
int InitializerToValue()
in Unix/mof/types.c
515 91 3
456 174 4
void SetPropertyValues()
in Unix/scriptext/py/PMI_Instance.c
436 50 3
414 46 1
static int _PromoteValue()
in Unix/mof/types.c
399 77 3
static int _PromoteValue()
in Unix/codec/mof/parser/types.c
386 78 5
void Print_Element_Value()
in Unix/scriptext/py/PythonBinding.c
350 64 3
MI_Result climain()
in Unix/cli/cli_c.c
341 79 2
bool DInstance::StaticToDynamic()
in Unix/micxx/dinstance.cpp
331 45 3
287 60 8
void GetConfigFileOptions()
in Unix/server/servercommon.c
285 61 0
int WS_GetInstance()
in Unix/wsman/wsmanparser.c
281 53 5
279 47 6
275 58 2
int WS_ParseWSHeader()
in Unix/wsman/wsmanparser.c
272 80 3
static void GenClassHeader()
in Unix/gen/gen.cpp
252 33 3
MI_Result Field_Construct()
in Unix/base/field.c
246 51 5