microsoft / bookings-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 6 units with 174 lines of code in units (67.4% of code).
    • 1 very long units (128 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (21 lines of code)
    • 0 small units (0 lines of code)
    • 4 very small units (25 lines of code)
73% | 0% | 12% | 0% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs73% | 0% | 12% | 0% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/BookingsSampleNativeConsole94% | 0% | 0% | 0% | 5%
src/Microsoft.Bookings.Client0% | 0% | 53% | 0% | 46%
Alternative Visuals
Longest Units
Top 6 longest units
Unit# linesMcCabe index# params
public static void Main()
in src/BookingsSampleNativeConsole/Program.cs
128 15 0
partial void OnContextCreated()
in src/Microsoft.Bookings.Client/GraphService.cs
21 3 0
public static T NewEntityWithChangeTracking()
in src/Microsoft.Bookings.Client/DataServiceQueryExtensions.cs
9 1 1
private static IConfiguration GetConfiguration()
in src/BookingsSampleNativeConsole/Program.cs
7 1 0
public GraphService()
in src/Microsoft.Bookings.Client/GraphService.cs
5 1 2
public static T PatchEntityWithChangeTracking()
in src/Microsoft.Bookings.Client/DataServiceQueryExtensions.cs
4 1 1