microsoft / VS-PPT
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 400 units with 5,066 lines of code in units (63.0% of code).
    • 0 very long units (0 lines of code)
    • 11 long units (729 lines of code)
    • 53 medium size units (1,607 lines of code)
    • 98 small units (1,446 lines of code)
    • 238 very small units (1,284 lines of code)
0% | 14% | 31% | 28% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 14% | 31% | 28% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Structure0% | 13% | 31% | 35% | 20%
src/CopyAsHtml0% | 15% | 37% | 21% | 25%
src/MatchMargin0% | 28% | 37% | 10% | 23%
src/TimeStampMargin0% | 26% | 21% | 30% | 20%
src/MiddleClickScroll0% | 35% | 24% | 9% | 31%
src/OptionsPage0% | 31% | 14% | 25% | 27%
src/PeekF10% | 0% | 30% | 26% | 42%
src/GoToDef0% | 0% | 35% | 37% | 27%
src/FixMixedTabs0% | 0% | 29% | 46% | 24%
src/SyntacticFisheye0% | 0% | 44% | 19% | 36%
src/TelemetryForPPT0% | 0% | 0% | 27% | 72%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static string CalculateLongestCommonWhitespacePrefix()
in src/CopyAsHtml/CopyAsHtml/HtmlMarkupProvider.cs
85 19 1
private void RedrawAdornments()
in src/MatchMargin/MatchMarginElement.cs
76 19 3
private void CreateBlockAdornments()
in src/Structure/StructureVisualizer/StructureAdornmentManager.cs
74 20 4
private void UpdateLineNumbers()
in src/TimeStampMargin/TimeStampMargin.cs
69 13 0
public bool Next()
in src/Structure/BlockTaggerImpl/BraceParser.cs
68 23 0
public override void PreprocessMouseMove()
in src/Structure/StructureVisualizer/StructureAdornmentManager.cs
65 17 1
public int Exec()
in src/CopyAsHtml/CopyAsHtml/CommandFilter.cs
62 16 5
private bool UpdateMatches()
in src/MatchMargin/MatchMarginElement.cs
59 15 1
public Task ParseAsync()
in src/Structure/BlockTaggerImpl/BraceParser.cs
59 11 2
private void OnTimerElapsed()
in src/MiddleClickScroll/MiddleClickScroll.cs
56 8 2
public OptionsControl()
in src/OptionsPage/OptionsControl.xaml.cs
56 11 2
public BackgroundSearch()
in src/MatchMargin/MatchMarginElement.cs
49 12 4
protected override void ParseSyntaxNode()
in src/Structure/BlockTaggerImpl/VbParser.cs
46 26 5
public static bool HasMixedTabsAndSpaces()
in src/FixMixedTabs/Impl/MixedTabsDetector.cs
45 11 2
private bool TryHighlightItemUnderMouse()
in src/GoToDef/GoToDefMouseHandler.cs
44 13 1
public void HandleLayoutChanged()
in src/PeekF1/src/ClippableWindowsFormsHost.cs
44 9 1
private BlockType FindType()
in src/Structure/BlockTaggerImpl/VbParser.cs
43 31 1
public bool UpdateTip()
in src/Structure/StructureVisualizer/StructureMarginElement.cs
43 14 3
private void DrawBlock()
in src/Structure/StructureVisualizer/StructureMarginElement.cs
40 11 3
public override void PreprocessMouseDown()
in src/MiddleClickScroll/MiddleClickScroll.cs
39 7 1