microsoft / WindowsCompositionSamples
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 311 units with 2,904 lines of code in units (42.0% of code).
    • 2 very long units (213 lines of code)
    • 5 long units (289 lines of code)
    • 22 medium size units (639 lines of code)
    • 37 small units (530 lines of code)
    • 245 very small units (1,233 lines of code)
7% | 9% | 22% | 18% | 42%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs7% | 9% | 22% | 18% | 42%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
SamplesCommon/SamplesCommon10% | 22% | 20% | 19% | 27%
ExpressionBuilder/ExpressionBuilder/ExpressionNodes15% | 8% | 21% | 7% | 47%
SampleGallery/Shared0% | 0% | 34% | 17% | 47%
SampleGallery/Pages0% | 0% | 70% | 12% | 16%
SamplesCommon/SamplesCommon/ImageLoader0% | 0% | 20% | 17% | 61%
SampleGallery0% | 0% | 17% | 46% | 35%
ExpressionBuilder/ExpressionBuilder0% | 0% | 0% | 15% | 84%
ExpressionBuilder/ExpressionBuilder/ReferenceNodes0% | 0% | 0% | 9% | 90%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static CompositionEasingFunction CreatePennerEquation()
in SamplesCommon/SamplesCommon/PennerEquationBuilder.cs
112 25 3
private string ToExpressionStringInternal()
in ExpressionBuilder/ExpressionBuilder/ExpressionNodes/ExpressionBuilder.ExpressionNode.cs
101 24 0
private void LightTypeSelection_SelectionChanged()
in SamplesCommon/SamplesCommon/LightControl.xaml.cs
72 5 2
private void UpdateLight()
in SamplesCommon/SamplesCommon/LightControl.xaml.cs
63 7 0
private async void LoadSurface()
in SamplesCommon/SamplesCommon/CompositionImage.cs
52 12 0
internal void SetAllParameters()
in ExpressionBuilder/ExpressionBuilder/ExpressionNodes/ExpressionBuilder.ExpressionNode.cs
51 12 1
protected override Size MeasureOverride()
in SamplesCommon/SamplesCommon/CompositionImage.cs
51 12 1
internal static T CreateExpressionNode()
in ExpressionBuilder/ExpressionBuilder/ExpressionNodes/ExpressionBuilder.ExpressionNode.cs
45 10 0
internal void EnsureReferenceInfo()
in ExpressionBuilder/ExpressionBuilder/ExpressionNodes/ExpressionBuilder.ExpressionNode.cs
39 10 0
public LocalDataSource()
in SampleGallery/Shared/LocalDataSource.cs
39 1 0
public async Task Draw()
in SamplesCommon/SamplesCommon/ImageLoader/BitmapDrawer.cs
36 5 4
private CompositionEffectBrush BuildBlurBrush()
in SamplesCommon/SamplesCommon/BackDrop.cs
33 1 0
protected override void OnNavigatedTo()
in SampleGallery/Pages/SearchResultsPage.xaml.cs
32 4 1
public FlipViewIndicator()
in SampleGallery/Shared/FlipViewIndicator.xaml.cs
32 6 0
internal protected T SubchannelsInternal()
in ExpressionBuilder/ExpressionBuilder/ExpressionNodes/ExpressionBuilder.ExpressionNode.cs
30 7 1
private void UpdatePerspectiveMatrix()
in SamplesCommon/SamplesCommon/PerspectivePanel.cs
30 3 0
public SwipeDismissPanel()
in SamplesCommon/SamplesCommon/SwipeDismissPanel.cs
30 1 0
public static Rect GetBoundingRect()
in SamplesCommon/SamplesCommon/VisualTreeHelperExtensions.cs
30 5 2
private void HideCustomSplashScreen()
in SampleGallery/MainPage.xaml.cs
29 1 0
protected override void OnNavigatedTo()
in SampleGallery/Pages/BaseCategoryPage.xaml.cs
28 4 1