microsoft / Windows-AppConsult-PWALab
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 88 units with 692 lines of code in units (3.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 19 small units (245 lines of code)
    • 69 very small units (447 lines of code)
0% | 0% | 0% | 35% | 64%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 0% | 30% | 69%
cs0% | 0% | 0% | 45% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Exercise2/02-End/Contoso.Dashboard0% | 0% | 0% | 68% | 31%
Exercise3/02-End/Contoso.WebAPI0% | 0% | 0% | 61% | 38%
Exercise3/02-End/Contoso.Dashboard0% | 0% | 0% | 33% | 66%
Exercise3/01-Start/Contoso.WebAPI0% | 0% | 0% | 51% | 48%
Exercise3/01-Start/Contoso.PushServer0% | 0% | 0% | 29% | 70%
Exercise3/02-End/Contoso.PushServer0% | 0% | 0% | 29% | 70%
Exercise3/01-Start/Contoso.Dashboard0% | 0% | 0% | 15% | 85%
Exercise1/01-Start/Contoso.Dashboard0% | 0% | 0% | 18% | 81%
Exercise1/02-End/Contoso.Dashboard0% | 0% | 0% | 18% | 81%
Exercise2/01-Start/Contoso.Dashboard0% | 0% | 0% | 18% | 81%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public ActionResult SaveChannel()
in Lab/Exercise3/01-Start/Contoso.WebAPI/Controllers/PushController.cs
15 1 1
public ActionResult SaveChannel()
in Lab/Exercise3/02-End/Contoso.WebAPI/Controllers/PushController.cs
15 1 1
public void Configure()
in Lab/Exercise3/01-Start/Contoso.PushServer/Startup.cs
14 2 2
public void ConfigureServices()
in Lab/Exercise3/01-Start/Contoso.WebAPI/Startup.cs
14 1 1
public void Configure()
in Lab/Exercise3/02-End/Contoso.PushServer/Startup.cs
14 2 2
public async Task SendNotification()
in Lab/Exercise3/02-End/Contoso.WebAPI/Controllers/PushController.cs
14 1 1
public void ConfigureServices()
in Lab/Exercise3/02-End/Contoso.WebAPI/Startup.cs
14 1 1
async function postSubscription()
in Lab/Exercise3/02-End/Contoso.Dashboard/js/sb-pwa.js
13 2 1
(function($)()
in Lab/Exercise1/01-Start/Contoso.Dashboard/js/sb-admin.js
12 1 1
(function($)()
in Lab/Exercise1/02-End/Contoso.Dashboard/js/sb-admin.js
12 1 1
(function($)()
in Lab/Exercise2/01-Start/Contoso.Dashboard/js/sb-admin.js
12 1 1
(function($)()
in Lab/Exercise2/02-End/Contoso.Dashboard/js/sb-admin.js
12 1 1
async function updateMessages()
in Lab/Exercise2/02-End/Contoso.Dashboard/js/sb-admin.js
12 2 0
async function updateTasks()
in Lab/Exercise2/02-End/Contoso.Dashboard/js/sb-admin.js
12 2 0
async function updateOrders()
in Lab/Exercise2/02-End/Contoso.Dashboard/js/sb-admin.js
12 2 0
async function updateTickets()
in Lab/Exercise2/02-End/Contoso.Dashboard/js/sb-admin.js
12 2 0
(function($)()
in Lab/Exercise3/01-Start/Contoso.Dashboard/js/sb-admin.js
12 1 1
(function($)()
in Lab/Exercise3/02-End/Contoso.Dashboard/js/sb-admin.js
12 1 1
function urlBase64ToUint8Array()
in Lab/Exercise3/02-End/Contoso.Dashboard/js/sb-pwa.js
12 2 1
async function updateMessages()
in Lab/Exercise3/01-Start/Contoso.Dashboard/js/sb-admin.js
10 1 0