microsoft / pmod
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 5,792 units with 68,342 lines of code in units (54.5% of code).
    • 39 very long units (6,411 lines of code)
    • 93 long units (6,268 lines of code)
    • 522 medium size units (15,570 lines of code)
    • 1,238 small units (17,760 lines of code)
    • 3,900 very small units (22,333 lines of code)
9% | 9% | 22% | 25% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp14% | 13% | 28% | 23% | 21%
c18% | 15% | 24% | 23% | 18%
h<1% | 1% | 11% | 33% | 52%
java0% | 5% | 17% | 10% | 66%
cs0% | 0% | 23% | 18% | 57%
mm0% | 0% | 16% | 18% | 64%
cc0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codegen28% | 22% | 25% | 11% | 11%
foundation18% | 6% | 22% | 28% | 23%
foundation_library17% | 8% | 26% | 24% | 23%
jansson24% | 12% | 23% | 22% | 18%
model_library3% | 13% | 30% | 26% | 25%
nodejs10% | 3% | 17% | 40% | 28%
model8% | 4% | 30% | 28% | 28%
winrt1% | 5% | 23% | 32% | 37%
proxy0% | 12% | 33% | 30% | 23%
public0% | 2% | 11% | 32% | 53%
java0% | 3% | 21% | 24% | 50%
coreclr0% | 0% | 20% | 17% | 62%
foundation_pal0% | 0% | 8% | 16% | 74%
src0% | 0% | 54% | 21% | 24%
pal0% | 0% | 10% | 47% | 41%
inc0% | 0% | 11% | 26% | 61%
objectivec0% | 0% | 14% | 22% | 63%
android0% | 0% | 0% | 89% | 10%
__generated0% | 0% | 0% | 0% | 100%
__build0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void CGenerateCSharpClasses::codeGenerate()
in src/codegen/tool/GenerateCSharpClasses.cpp
378 67 1
void CGenerateObjectiveC::codeGenerate()
in src/codegen/tool/GenerateObjectiveC.cpp
314 43 1
void CGenerateWindowsRuntimeAdapter::codeGenerate()
in src/codegen/tool/GenerateWindowsRuntimeAdapter.cpp
290 45 1
void CGenerateFastCppTemplate::codeGenerate()
in src/codegen/tool/GenerateFastCppTemplate.cpp
274 41 1
HRESULT CPropertyValueInternalStatics::ChangeTypeInternal()
in src/foundation/PropertyValueInternalStatics.cpp
258 54 2
static HRESULT ExpressionToRpn()
in src/foundation_library/Expression.cpp
220 39 3
static HRESULT PropertyValueToJson()
in src/foundation_library/JsonStatics.cpp
216 30 2
static int do_dump()
in src/jansson/src/dump.c
195 46 5
STDMETHODIMP CPropertyValueInternalStatics::ComparePropertyValues()
in src/foundation/PropertyValueInternalStatics.cpp
190 29 3
void CGenerateFastCppTemplate::emitPropertyAccessMethods()
in src/codegen/tool/GenerateFastCppTemplate.cpp
188 33 5
void CGenerateJava::codeGenerate()
in src/codegen/tool/GenerateJava.cpp
185 25 1
HRESULT CPropertyValueInternalStatics::Serialize()
in src/foundation/PropertyValueInternalStatics.cpp
181 34 3
static HRESULT EvaluateRpnExpression()
in src/foundation_library/Expression.cpp
178 44 3
HRESULT CPropertyValueInternalStatics::Deserialize()
in src/foundation/PropertyValueInternalStatics.cpp
176 34 3
void CGenerateNetInterop::codeGenerate()
in src/codegen/tool/GenerateNetInterop.cpp
175 35 1
HRESULT InspectableToLocalValue()
in src/nodejs/NodeJsHelper.cpp
164 51 3
static uint32_t hashlittle()
in src/jansson/src/lookup3.h
152 63 3
HRESULT CFastContainerUtil::SetPropertyValue()
in src/foundation_library/FastContainerUtil.cpp
147 30 3
void CGenerateCppLibrary::emitMethodHandler()
in src/codegen/tool/GenerateCppLibrary.cpp
141 20 4
foundation::string_t CPropertyValueInternalStatics::ToString()
in src/foundation/PropertyValueInternalStatics.cpp
140 28 1