aws-samples / amazon-ecs-windows-authentication-blog
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 14 units with 324 lines of code in units (60.8% of code).
    • 1 very long units (108 lines of code)
    • 2 long units (137 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (38 lines of code)
    • 9 very small units (41 lines of code)
33% | 42% | 0% | 11% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts44% | 55% | 0% | 0% | 0%
cs0% | 0% | 0% | 48% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/lib100% | 0% | 0% | 0% | 0%
web-site/cdk/lib0% | 100% | 0% | 0% | 0%
web-site/Controllers0% | 0% | 0% | 45% | 54%
web-site0% | 0% | 0% | 51% | 48%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
constructor()
in cdk/lib/cdk-stack.ts
108 1 3
constructor()
in web-site/cdk/lib/application-stack.ts
86 1 3
constructor()
in web-site/cdk/lib/database-stack.ts
51 1 3
protected List GetAlbums()
in web-site/Controllers/HomeController.cs
19 2 0
public void Configure()
in web-site/Startup.cs
19 3 2
public IActionResult Index()
in web-site/Controllers/HomeController.cs
6 1 0
6 1 1
public HomeController()
in web-site/Controllers/HomeController.cs
5 1 2
public IActionResult Privacy()
in web-site/Controllers/HomeController.cs
4 1 0
public IActionResult HealthCheck()
in web-site/Controllers/HomeController.cs
4 1 0
public IActionResult Error()
in web-site/Controllers/HomeController.cs
4 1 0
public Startup()
in web-site/Startup.cs
4 1 1
public void ConfigureServices()
in web-site/Startup.cs
4 1 1
public static void Main()
in web-site/Program.cs
4 1 1