aws-samples / aws-net-guides
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 106 units with 1,511 lines of code in units (46.6% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (118 lines of code)
    • 27 medium size units (728 lines of code)
    • 28 small units (418 lines of code)
    • 49 very small units (247 lines of code)
0% | 7% | 48% | 27% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 28% | 33% | 7% | 30%
cs0% | 4% | 50% | 30% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Serverless/Serverless Web App with React, DynamoDb, and X-Ray0% | 15% | 25% | 27% | 31%
Storage/DynamoDb0% | 9% | 77% | 3% | 9%
Storage/Glacier0% | 0% | 33% | 66% | 0%
Communications/SES-SendMail-Example0% | 0% | 100% | 0% | 0%
Storage/Kinesis0% | 0% | 39% | 48% | 11%
Storage/S30% | 0% | 20% | 72% | 8%
Communications/ParameterStore-Example0% | 0% | 0% | 76% | 23%
Containers/Deploy-ASP.NET-Core-To-Fargate0% | 0% | 0% | 39% | 60%
Serverless/Serverless App with Dynamo-Example0% | 0% | 0% | 57% | 42%
Serverless/Create .NET Lambda Function0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in Serverless/Serverless Web App with React, DynamoDb, and X-Ray/ClientApp/src/components/Quiz.js
61 2 0
public async Task Create()
in Storage/DynamoDb/SampleApplication/Controllers/LowLevel/TablesController.cs
57 7 1
public async Task Create()
in Storage/DynamoDb/SampleApplication/Controllers/Document/ProductsController.cs
37 5 1
public async Task Create()
in Storage/DynamoDb/SampleApplication/Controllers/ObjectPersistence/ProductsController.cs
36 5 1
static void SetVaultAccessPolicy()
in Storage/Glacier/SampleApplication/Program.cs
33 2 1
static void Main()
in Communications/SES-SendMail-Example/SampleApplication/Program.cs
31 2 1
public async Task Update()
in Storage/DynamoDb/SampleApplication/Controllers/LowLevel/TablesController.cs
31 4 2
public async Task Get()
in Storage/DynamoDb/SampleApplication/Controllers/LowLevel/TablesController.cs
30 4 1
sendAnswers()
in Serverless/Serverless Web App with React, DynamoDb, and X-Ray/ClientApp/src/components/Quiz.js
29 2 1
public async Task Build()
in Storage/DynamoDb/SampleApplication/Utilities/DynamoDBTableBuilder.cs
29 3 0
public async Task Build()
in Storage/DynamoDb/SampleApplication/Utilities/DynamoDBContextBuilder.cs
29 3 0
public void Configure()
in Serverless/Serverless Web App with React, DynamoDb, and X-Ray/Startup.cs
28 3 2
public async Task Update()
in Storage/DynamoDb/SampleApplication/Controllers/ObjectPersistence/ProductsController.cs
28 5 3
public async Task Get()
in Storage/DynamoDb/SampleApplication/Controllers/LowLevel/ItemsController.cs
28 5 1
private static void PublishDeviceDataToKinesis()
in Storage/Kinesis/SampleApplication/Program.cs
27 3 1
public async Task Update()
in Storage/DynamoDb/SampleApplication/Controllers/Document/ProductsController.cs
27 5 3
public async Task GetTableStatus()
in Storage/DynamoDb/SampleApplication/Controllers/LowLevel/TablesController.cs
26 4 1
static void Main()
in Storage/S3/SampleApplication/Program.cs
25 1 1
public async Task Get()
in Storage/DynamoDb/SampleApplication/Controllers/ObjectPersistence/ProductsController.cs
25 5 2
public async Task Delete()
in Storage/DynamoDb/SampleApplication/Controllers/ObjectPersistence/ProductsController.cs
25 5 2