aws-samples / cdk-lambda-packaging-java
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 7 units with 131 lines of code in units (64.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (75 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (36 lines of code)
    • 4 very small units (20 lines of code)
0% | 57% | 0% | 27% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 57% | 0% | 27% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/src/main/java/com/myorg0% | 90% | 0% | 0% | 9%
software/FunctionOne/src/main/java/helloworld0% | 0% | 0% | 75% | 25%
software/FunctionTwo/src/main/java/helloworld0% | 0% | 0% | 75% | 25%
Alternative Visuals
Longest Units
Top 7 longest units
Unit# linesMcCabe index# params
public InfrastructureStack()
in infrastructure/src/main/java/com/myorg/InfrastructureStack.java
75 1 3
public APIGatewayProxyResponseEvent handleRequest()
in software/FunctionOne/src/main/java/helloworld/App.java
18 2 2
public APIGatewayProxyResponseEvent handleRequest()
in software/FunctionTwo/src/main/java/helloworld/App.java
18 2 2
private String getPageContents()
in software/FunctionOne/src/main/java/helloworld/App.java
6 1 1
private String getPageContents()
in software/FunctionTwo/src/main/java/helloworld/App.java
6 1 1
public static void main()
in infrastructure/src/main/java/com/myorg/InfrastructureApp.java
5 1 1
public InfrastructureStack()
in infrastructure/src/main/java/com/myorg/InfrastructureStack.java
3 1 2