microsoft / Windows-appsample-familynotes
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 169 units with 2,474 lines of code in units (59.6% of code).
    • 1 very long units (111 lines of code)
    • 6 long units (395 lines of code)
    • 30 medium size units (856 lines of code)
    • 44 small units (651 lines of code)
    • 88 very small units (461 lines of code)
4% | 15% | 34% | 26% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs4% | 15% | 34% | 26% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
FamilyNotes10% | 19% | 30% | 23% | 15%
FamilyNotes/Speech0% | 25% | 41% | 23% | 9%
FamilyNotes/UserDetection0% | 17% | 51% | 16% | 15%
FamilyNotes/Controls0% | 0% | 16% | 49% | 34%
FamilyNotes/AppDialogs0% | 0% | 46% | 14% | 39%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
111 14 2
87 12 1
public static async Task TrainDetectionAsync()
in FamilyNotes/UserDetection/FacialSimilarity.cs
73 8 0
private async Task LoadModelAsync()
in FamilyNotes/App.xaml.cs
64 8 0
public async Task StartContinuousRecognition()
in FamilyNotes/Speech/SpeechManager.cs
61 6 0
58 11 2
public async Task SaveModelAsync()
in FamilyNotes/App.xaml.cs
52 7 0
private async void CountDetectedFaces()
in FamilyNotes/UserDetection/UserPresence.cs
47 12 1
private async Task EnableFaceDetection()
in FamilyNotes/MainPage.xaml.cs
37 6 0
public static async Task CheckForUserAsync()
in FamilyNotes/UserDetection/FacialSimilarity.cs
37 5 1
35 6 1
private async void AddNewPersonDialog()
in FamilyNotes/MainPage.xaml.cs
35 6 1
private CommandVerb GetPhraseIntent()
in FamilyNotes/Speech/SpeechManager.cs
33 10 1
private void PopulatePhrases()
in FamilyNotes/Speech/SpeechManager.cs
32 4 0
private async Task InitializeCameraAsync()
in FamilyNotes/UserDetection/UserPresence.cs
32 6 0
private async void ContentDialog_PersonName_TextChanged()
in FamilyNotes/AppDialogs/AddPersonContentDialog.xaml.cs
30 4 2
30 7 2
private async Task IsMicrophoneAvailable()
in FamilyNotes/Speech/SpeechManager.cs
30 4 0
private async Task EndRecognitionSession()
in FamilyNotes/Speech/SpeechManager.cs
30 4 0
public static async Task AddTrainingImageAsync()
in FamilyNotes/UserDetection/FacialSimilarity.cs
29 5 2