aws-samples / aws-dynamodb-examples
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 637 units with 4,989 lines of code in units (49.2% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (416 lines of code)
    • 52 medium size units (1,572 lines of code)
    • 75 small units (1,106 lines of code)
    • 503 very small units (1,895 lines of code)
0% | 8% | 31% | 22% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 34% | 58% | 0% | 6%
go0% | 5% | 43% | 26% | 24%
js0% | 7% | 52% | 24% | 15%
java0% | 2% | 11% | 25% | 60%
py0% | 0% | 0% | 29% | 70%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DynamoDB-SDK-Examples/dotnet0% | 34% | 58% | 0% | 6%
DynamoDB-SDK-Examples/golang0% | 5% | 43% | 26% | 24%
DynamoDB-SDK-Examples/node.js0% | 7% | 52% | 24% | 15%
DynamoDB-SDK-Examples/java0% | 2% | 11% | 25% | 60%
DynamoDB-SDK-Examples/python0% | 0% | 0% | 26% | 73%
LoadS3toDynamoDB0% | 0% | 0% | 37% | 62%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static async Task TransactWriteItemsExample()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/TransactWriteItems.cs
72 3 0
func main()
in DynamoDB-SDK-Examples/golang/WorkingWithItems/batchWriteItem.go
67 2 0
public static async Task BatchWriteExampleAsync()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/BatchWriteItem.cs
58 2 0
async function batchWriteItems()
in DynamoDB-SDK-Examples/node.js/WorkingWithItems/batch-write.js
57 2 0
public static async Task CreateTable()
in DynamoDB-SDK-Examples/dotnet/WorkingWithTables/CreateTableProvisioned.cs
57 2 0
public static void main()
in DynamoDB-SDK-Examples/java/WorkingWithItems/TransactWriteItem.java
53 1 1
public static async Task TransactGetItemsExample()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/TransactGetItems.cs
52 4 0
public static void main()
in DynamoDB-SDK-Examples/java/WorkingWithItems/BatchWriteItem.java
48 1 1
public static async Task ServiceClientExampleAsync()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/BatchGetItem.cs
45 3 0
async function createIndex()
in DynamoDB-SDK-Examples/node.js/WorkingWithIndexes/CreateIndex.js
44 2 0
func main()
in DynamoDB-SDK-Examples/golang/WorkingWithItems/batchGetItem.go
44 2 0
func createTable()
in DynamoDB-SDK-Examples/golang/WorkingWithTables/createTableProvisioned/createTableProvisioned.go
44 3 0
async function transactWriteItems()
in DynamoDB-SDK-Examples/node.js/WorkingWithItems/transact-write.js
43 2 0
func main()
in DynamoDB-SDK-Examples/golang/WorkingWithItems/putItemConditional.go
41 3 0
func createTable()
in DynamoDB-SDK-Examples/golang/WorkingWithTables/createTableOnDemand/createTableOnDemand.go
41 3 0
public async Task ServiceClientExampleAsync()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/PutItemConditional.cs
41 2 0
func main()
in DynamoDB-SDK-Examples/golang/WorkingWithItems/putItem.go
40 3 0
func main()
in DynamoDB-SDK-Examples/golang/WorkingWithItems/getItem.go
40 4 0
public async Task ServiceClientExampleAsync()
in DynamoDB-SDK-Examples/dotnet/WorkingWithItems/PutItem.cs
40 2 0
async function getItems()
in DynamoDB-SDK-Examples/node.js/WorkingWithCustomBackoffRetry/exponential_backoff_retry_get_item.js
37 6 0