microsoft / vswhere
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 172 units with 2,298 lines of code in units (52.9% of code).
    • 2 very long units (275 lines of code)
    • 6 long units (385 lines of code)
    • 23 medium size units (615 lines of code)
    • 34 small units (489 lines of code)
    • 107 very small units (534 lines of code)
11% | 16% | 26% | 21% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp13% | 18% | 27% | 22% | 17%
h0% | 0% | 21% | 10% | 68%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/vswhere.lib12% | 13% | 26% | 22% | 24%
src/vswhere0% | 61% | 31% | 6% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void CommandArgs::Parse()
in src/vswhere.lib/CommandArgs.cpp
156 37 1
STDMETHODIMP VersionRange::ParseVersionRange()
in src/vswhere.lib/VersionRange.cpp
119 24 3
int wmain()
in src/vswhere/Program.cpp
97 14 2
void Formatter::WriteInternal()
in src/vswhere.lib/Formatter.cpp
66 21 1
vector InstanceSelector::Select()
in src/vswhere.lib/InstanceSelector.cpp
59 16 1
HRESULT VersionRange::ParseVersionString()
in src/vswhere.lib/VersionRange.cpp
57 11 3
bool Formatter::WriteProperties()
in src/vswhere.lib/Formatter.cpp
54 14 2
bool InstanceSelector::Less()
in src/vswhere.lib/InstanceSelector.cpp
52 10 2
void Formatter::WritePackage()
in src/vswhere.lib/Formatter.cpp
42 13 1
bool InstanceSelector::IsWorkloadMatch()
in src/vswhere.lib/InstanceSelector.cpp
42 7 1
wstring Formatter::FormatDate()
in src/vswhere.lib/Formatter.cpp
40 7 1
bool InstanceSelector::IsMatch()
in src/vswhere.lib/InstanceSelector.cpp
35 9 1
bool LegacyProvider::TryGetLegacyInstance()
in src/vswhere.lib/LegacyProvider.cpp
33 7 2
STDMETHODIMP QueryInterface()
in src/vswhere.lib/VersionRange.h
31 5 2
void GetEnumerator()
in src/vswhere/Program.cpp
28 7 3
bool InstanceSelector::IsProductMatch()
in src/vswhere.lib/InstanceSelector.cpp
27 6 1
void JsonScope::WriteStartImpl()
in src/vswhere.lib/JsonScope.cpp
27 5 0
vector CommandParser::Parse()
in src/vswhere.lib/CommandParser.cpp
26 7 2
STDMETHODIMP QueryInterface()
in src/vswhere.lib/LegacyInstance.h
25 4 2
bool Glob::RequiresEscape()
in src/vswhere.lib/Glob.cpp
24 3 1