aws-samples / dotnet-modernization-music-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 38 units with 806 lines of code in units (21.8% of code).
    • 1 very long units (417 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (168 lines of code)
    • 4 small units (66 lines of code)
    • 26 very small units (155 lines of code)
51% | 0% | 20% | 8% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs51% | 0% | 20% | 8% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
MvcMusicStore/Models76% | 0% | 11% | 2% | 8%
MvcMusicStore/Controllers0% | 0% | 42% | 20% | 36%
MvcMusicStore0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected override void Seed()
in MvcMusicStore/Models/SampleData.cs
417 1 1
public ActionResult AddressAndPayment()
in MvcMusicStore/Controllers/CheckoutController.cs
28 3 1
private static string ErrorCodeToString()
in MvcMusicStore/Controllers/AccountController.cs
26 10 1
public ActionResult LogOn()
in MvcMusicStore/Controllers/AccountController.cs
25 8 2
public ActionResult ChangePassword()
in MvcMusicStore/Controllers/AccountController.cs
25 4 1
public void AddToCart()
in MvcMusicStore/Models/ShoppingCart.cs
22 3 1
public int RemoveFromCart()
in MvcMusicStore/Models/ShoppingCart.cs
21 4 1
public int CreateOrder()
in MvcMusicStore/Models/ShoppingCart.cs
21 2 1
public ActionResult Register()
in MvcMusicStore/Controllers/AccountController.cs
19 3 1
public ActionResult RemoveFromCart()
in MvcMusicStore/Controllers/ShoppingCartController.cs
17 1 1
public string GetCartId()
in MvcMusicStore/Models/ShoppingCart.cs
16 3 1
public ActionResult Complete()
in MvcMusicStore/Controllers/CheckoutController.cs
14 3 1
public ActionResult Index()
in MvcMusicStore/Controllers/ShoppingCartController.cs
10 1 0
public static void RegisterRoutes()
in MvcMusicStore/Global.asax.cs
9 1 1
public void EmptyCart()
in MvcMusicStore/Models/ShoppingCart.cs
9 2 0
public void MigrateCart()
in MvcMusicStore/Models/ShoppingCart.cs
9 2 1
public ActionResult AddToCart()
in MvcMusicStore/Controllers/ShoppingCartController.cs
8 1 1
protected void Application_Start()
in MvcMusicStore/Global.asax.cs
7 1 0
private List GetTopSellingAlbums()
in MvcMusicStore/Controllers/HomeController.cs
7 1 1
public int GetCount()
in MvcMusicStore/Models/ShoppingCart.cs
7 1 0