microsoft / Windows.UI.Composition-Win32-Samples
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 748 units with 8,919 lines of code in units (63.5% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (444 lines of code)
    • 72 medium size units (2,025 lines of code)
    • 255 small units (3,664 lines of code)
    • 414 very small units (2,786 lines of code)
0% | 4% | 22% | 41% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 5% | 19% | 45% | 29%
cs0% | 5% | 31% | 30% | 32%
h0% | 0% | 14% | 38% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cpp/AdvancedColorImages/AdvancedColorImages0% | 15% | 37% | 29% | 18%
cpp/ScreenCaptureforHWND/ScreenCaptureforHWND0% | 19% | 32% | 20% | 28%
dotnet/WinForms/VisualLayerIntegration0% | 11% | 34% | 19% | 33%
cpp/HelloComposition/HelloComposition0% | 16% | 15% | 42% | 25%
cpp/HelloVectors0% | 1% | 14% | 49% | 34%
dotnet/WPF/VisualLayerIntegration0% | 7% | 26% | 39% | 26%
dotnet/WPF/ScreenCapture0% | 0% | 39% | 24% | 36%
cpp/VirtualSurfaces/VirtualSurfaces0% | 0% | 25% | 43% | 30%
dotnet/WinForms/AcrylicEffect0% | 0% | 35% | 37% | 27%
dotnet/WPF/AcrylicEffect0% | 0% | 20% | 50% | 29%
dotnet/WinForms/HelloComposition0% | 0% | 22% | 20% | 56%
dotnet/WPF/HelloComposition0% | 0% | 16% | 47% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
ImageInfo DirectXTileRenderer::LoadImageCommon()
in cpp/AdvancedColorImages/AdvancedColorImages/DirectXTileRenderer.cpp
88 6 1
int CALLBACK WinMain()
in cpp/ScreenCaptureforHWND/ScreenCaptureforHWND/main.cpp
73 3 4
private void InitializeComponent()
in dotnet/WinForms/VisualLayerIntegration/VisualLayerIntegration/Form1.Designer.cs
65 1 0
LRESULT CALLBACK WndProc()
in cpp/AdvancedColorImages/AdvancedColorImages/AdvancedColorImages.cpp
61 11 4
LRESULT CALLBACK WndProc()
in cpp/HelloComposition/HelloComposition/HelloComposition.cpp
53 8 4
ShapeVisual ShapeVisual()
in cpp/HelloVectors/LottieLogo1.cpp
52 1 0
public BarGraph()
in dotnet/WPF/VisualLayerIntegration/VisualLayerIntegration/BarGraphUtility/BarGraph.cs
52 3 13
void TileDrawingManager::UpdateVisibleRegion()
in cpp/AdvancedColorImages/AdvancedColorImages/TileDrawingManager.cpp
47 10 1
void TileDrawingManager::UpdateVisibleRegion()
in cpp/VirtualSurfaces/VirtualSurfaces/TileDrawingManager.cpp
47 10 1
IGraphicsEffect CreateAcrylicEffectGraph()
in dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs
46 1 0
private IGraphicsEffect CreateAcrylicEffectGraph()
in dotnet/WinForms/AcrylicEffect/AcrylicEffect/Form1.cs
46 1 0
void DirectXTileRenderer::CreateImageDependentResources()
in cpp/AdvancedColorImages/AdvancedColorImages/DirectXTileRenderer.cpp
44 1 0
public void DrawText()
in dotnet/WinForms/VisualLayerIntegration/VisualLayerIntegration/BarGraphUtility/BarGraph.cs
44 1 5
public void DrawText()
in dotnet/WPF/VisualLayerIntegration/VisualLayerIntegration/BarGraphUtility/BarGraph.cs
43 1 5
public BarGraph()
in dotnet/WinForms/VisualLayerIntegration/VisualLayerIntegration/BarGraphUtility/BarGraph.cs
41 3 13
void DirectXTileRenderer::ComputeHdrMetadata()
in cpp/AdvancedColorImages/AdvancedColorImages/DirectXTileRenderer.cpp
38 7 0
void SimpleCapture::OnFrameArrived()
in cpp/ScreenCaptureforHWND/ScreenCaptureforHWND/SimpleCapture.cpp
38 4 2
bool IsAltTabWindow()
in cpp/ScreenCaptureforHWND/ScreenCaptureforHWND/Win32WindowEnumeration.h
36 8 1
public BasicCapture()
in dotnet/WPF/ScreenCapture/CaptureSampleCore/BasicCapture.cs
34 1 2
bool DirectXTileRenderer::DrawTile()
in cpp/AdvancedColorImages/AdvancedColorImages/DirectXTileRenderer.cpp
33 4 1