aws-samples / modernization-unicorn-store
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 111 units with 1,507 lines of code in units (35.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (162 lines of code)
    • 24 medium size units (642 lines of code)
    • 22 small units (344 lines of code)
    • 62 very small units (359 lines of code)
0% | 10% | 42% | 22% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 8% | 39% | 26% | 25%
js0% | 26% | 59% | 0% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
UnicornStore0% | 60% | 0% | 29% | 10%
UnicornStore/wwwroot0% | 26% | 59% | 0% | 13%
UnicornStore/Controllers0% | 0% | 47% | 27% | 25%
UnicornStore/Areas0% | 0% | 37% | 32% | 29%
UnicornStore/Data0% | 0% | 69% | 21% | 9%
UnicornStore/Models0% | 0% | 40% | 17% | 42%
UnicornStore/Components0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
applyMedia = function()
in UnicornStore/wwwroot/Scripts/respond.js
55 27 1
public void Configure()
in UnicornStore/Startup.cs
54 4 2
public void ConfigureServices()
in UnicornStore/Startup.cs
53 2 1
(function( win )()
in UnicornStore/wwwroot/Scripts/respond.js
40 7 1
public async Task AddressAndPayment()
in UnicornStore/Controllers/CheckoutController.cs
36 4 3
public async Task ExternalLoginConfirmation()
in UnicornStore/Controllers/AccountController.cs
34 7 2
public async Task RemoveFromCart()
in UnicornStore/Controllers/ShoppingCartController.cs
34 3 2
translate = function()
in UnicornStore/wwwroot/Scripts/respond.js
33 17 3
public async Task Details()
in UnicornStore/Areas/Admin/Controllers/StoreManagerController.cs
31 5 2
public async Task Details()
in UnicornStore/Controllers/StoreController.cs
30 5 2
public async Task ExternalLoginCallback()
in UnicornStore/Controllers/AccountController.cs
28 5 1
ripCSS = function()
in UnicornStore/wwwroot/Scripts/respond.js
27 11 0
public async Task Login()
in UnicornStore/Controllers/AccountController.cs
27 5 2
public async Task SendCode()
in UnicornStore/Controllers/AccountController.cs
27 6 1
private static async Task CreateAdminUser()
in UnicornStore/Data/DbInitializer.cs
26 5 2
public static ShoppingCart GetCart()
in UnicornStore/Models/ShoppingCart.cs
25 3 2
public async Task Register()
in UnicornStore/Controllers/AccountController.cs
24 3 1
public async Task Index()
in UnicornStore/Controllers/HomeController.cs
24 5 2
public async Task ForgotPassword()
in UnicornStore/Controllers/AccountController.cs
23 4 1
private static async Task AddOrUpdateAsync()
in UnicornStore/Data/DbInitializer.cs
23 3 3