aws-samples / serverless-graalvm-demo
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 35 units with 451 lines of code in units (63.2% of code).
    • 1 very long units (122 lines of code)
    • 1 long units (60 lines of code)
    • 4 medium size units (132 lines of code)
    • 3 small units (41 lines of code)
    • 26 very small units (96 lines of code)
27% | 13% | 29% | 9% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java27% | 13% | 29% | 9% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/src/main/java/software/amazonaws/example/infrastructure58% | 28% | 0% | 8% | 4%
software/products/src/main/java/software/amazonaws/example/product/entrypoints0% | 0% | 88% | 0% | 12%
software/products/src/main/java/software/amazonaws/example/product/store/dynamodb0% | 0% | 0% | 46% | 53%
software/products/src/main/java/software/amazonaws/example/product/model0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public InfrastructureStack()
in infrastructure/src/main/java/software/amazonaws/example/infrastructure/InfrastructureStack.java
122 1 3
public DashboardStack()
in infrastructure/src/main/java/software/amazonaws/example/infrastructure/DashboardStack.java
60 2 4
public APIGatewayV2HTTPResponse handleRequest()
in software/products/src/main/java/software/amazonaws/example/product/entrypoints/ApiGatewayPutProductRequestHandler.java
49 7 2
public APIGatewayV2HTTPResponse handleRequest()
in software/products/src/main/java/software/amazonaws/example/product/entrypoints/ApiGatewayGetProductRequestHandler.java
32 4 2
public APIGatewayV2HTTPResponse handleRequest()
in software/products/src/main/java/software/amazonaws/example/product/entrypoints/ApiGatewayDeleteProductRequestHandler.java
26 3 2
public APIGatewayV2HTTPResponse handleRequest()
in software/products/src/main/java/software/amazonaws/example/product/entrypoints/ApiGatewayGetAllProductRequestHandler.java
25 3 2
public static void main()
in infrastructure/src/main/java/software/amazonaws/example/infrastructure/InfrastructureApp.java
18 1 1
public Products getAllProduct()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/DynamoDbProductStore.java
12 2 0
public Optional getProduct()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/DynamoDbProductStore.java
11 2 1
public static Product productFromDynamoDB()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/ProductMapper.java
7 1 1
public static Map productToDynamoDb()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/ProductMapper.java
7 1 1
public String toString()
in software/products/src/main/java/software/amazonaws/example/product/model/Product.java
7 1 0
public void putProduct()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/DynamoDbProductStore.java
6 1 1
public void deleteProduct()
in software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/DynamoDbProductStore.java
6 1 1
public Product()
in software/products/src/main/java/software/amazonaws/example/product/model/Product.java
5 1 3
public Products()
in software/products/src/main/java/software/amazonaws/example/product/model/Products.java
3 1 1
public List getProducts()
in software/products/src/main/java/software/amazonaws/example/product/model/Products.java
3 1 0
public void setProducts()
in software/products/src/main/java/software/amazonaws/example/product/model/Products.java
3 1 1
public String getId()
in software/products/src/main/java/software/amazonaws/example/product/model/Product.java
3 1 0
public void setId()
in software/products/src/main/java/software/amazonaws/example/product/model/Product.java
3 1 1