microsoft / Xaml-Controls-Gallery
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 769 units with 8,037 lines of code in units (35.5% of code).
    • 0 very long units (0 lines of code)
    • 13 long units (858 lines of code)
    • 72 medium size units (1,968 lines of code)
    • 164 small units (2,411 lines of code)
    • 520 very small units (2,800 lines of code)
0% | 10% | 24% | 29% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 10% | 24% | 29% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
XamlControlsGallery/ControlPages0% | 10% | 20% | 34% | 35%
XamlControlsGallery0% | 16% | 13% | 28% | 42%
XamlControlsGallery/Common0% | 9% | 37% | 21% | 30%
XamlControlsGallery/DataModel0% | 55% | 0% | 10% | 34%
XamlControlsGallery/Controls0% | 17% | 38% | 22% | 22%
XamlControlsGallery/Navigation0% | 0% | 62% | 17% | 19%
XamlControlsGallery/TabViewPages0% | 0% | 51% | 24% | 24%
XamlControlsGallery/Helper0% | 0% | 19% | 43% | 37%
XamlControlsGallery/Behaviors0% | 0% | 54% | 0% | 45%
XamlControlsGallery/ConnectedAnimationPages0% | 0% | 0% | 43% | 56%
XamlControlsGallery/SamplePages0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public LanguageList()
in XamlControlsGallery/Common/LanguageList.cs
93 2 0
private ObservableCollection GetData()
in XamlControlsGallery/ControlPages/TreeViewPage.xaml.cs
79 1 0
private async Task GetControlInfoDataAsync()
in XamlControlsGallery/DataModel/ControlInfoDataSource.cs
77 15 0
private async Task EnsureWindow()
in XamlControlsGallery/App.xaml.cs
72 14 1
private void ItemTemplate_Checked()
in XamlControlsGallery/ControlPages/GridViewPage.xaml.cs
71 5 2
private void Scroller4_ScrollAnimationStarting()
in XamlControlsGallery/ControlPages/ScrollViewer2Page.xaml.cs
68 8 2
private void Scroller4_ZoomAnimationStarting()
in XamlControlsGallery/ControlPages/ScrollViewer2Page.xaml.cs
63 8 2
public async void TakeScreenshotWithDelay()
in XamlControlsGallery/Controls/ControlExample.xaml.cs
62 6 0
private void RadioBtn_Click()
in XamlControlsGallery/ControlPages/ItemsRepeaterPage.xaml.cs
56 6 2
private async void ListView_Drop()
in XamlControlsGallery/ControlPages/ListViewPage.xaml.cs
56 15 2
public PullToRefreshPage()
in XamlControlsGallery/ControlPages/PullToRefreshPage.xaml.cs
56 9 0
private void BuildFilterList()
in XamlControlsGallery/SearchResultsPage.xaml.cs
54 10 1
private void AddSecondaryCommands_Click()
in XamlControlsGallery/ControlPages/CommandBarPage.xaml.cs
51 2 2
protected override Size ArrangeOverride()
in XamlControlsGallery/Common/WrapPanel.cs
48 10 1
private void InitializeData()
in XamlControlsGallery/ControlPages/ItemsRepeaterPage.xaml.cs
48 3 0
public void EnsureItemIsVisibleInNavigation()
in XamlControlsGallery/Navigation/NavigationRootPage.xaml.cs
47 9 1
protected override Size MeasureOverride()
in XamlControlsGallery/Common/VariedImageSizeLayout.cs
46 9 2
private void OnNavigationViewItemInvoked()
in XamlControlsGallery/Navigation/NavigationRootPage.xaml.cs
46 10 2
protected override Size MeasureOverride()
in XamlControlsGallery/Common/WrapPanel.cs
42 8 1
private void NavigateToNumberedTabKeyboardAccelerator_Invoked()
in XamlControlsGallery/ControlPages/TabViewPage.xaml.cs
40 11 2