aws-samples / serverless-webapp-mono-repo-ci-cd-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 43 units with 976 lines of code in units (31.0% of code).
    • 2 very long units (295 lines of code)
    • 1 long units (55 lines of code)
    • 14 medium size units (410 lines of code)
    • 9 small units (119 lines of code)
    • 17 very small units (97 lines of code)
30% | 5% | 42% | 12% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java44% | 0% | 33% | 11% | 10%
py0% | 38% | 38% | 11% | 11%
ts0% | 0% | 79% | 10% | 9%
tsx0% | 0% | 79% | 20% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend-infrastructure/src69% | 0% | 17% | 3% | 10%
python-app-backend/lambda0% | 38% | 38% | 11% | 11%
java-app-backend/BackendFunction0% | 0% | 61% | 27% | 10%
frontend/src0% | 0% | 79% | 14% | 6%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public FrontEndPipelineStack()
in frontend-infrastructure/src/main/java/com/recognise/frontend/pipeline/FrontEndPipelineStack.java
181 4 3
public FrontEndCdkPipelineStack()
in frontend-infrastructure/src/main/java/com/recognise/frontend/pipeline/FrontEndCdkPipelineStack.java
114 4 3
def lambda_handler()
in python-app-backend/lambda/rekognize-image/main.py
55 5 2
export default function ButtonAppBar()
in frontend/src/Header.tsx
47 1 0
public APIGatewayProxyResponseEvent handleRequest()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/RecognizeImageHandler.java
44 5 2
function registerValidSW()
in frontend/src/serviceWorker.ts
33 8 2
def lambda_handler()
in python-app-backend/lambda/pre-signed-url-generator/main.py
32 3 2
public APIGatewayProxyResponseEvent handleRequest()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/ImageUploadHandler.java
32 3 2
private CloudFrontWebDistribution distribution()
in frontend-infrastructure/src/main/java/com/recognise/FrontendInfrastructureStack.java
30 2 3
private void sendResponse()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/CreateCollectionHandler.java
26 2 3
public APIGatewayProxyResponseEvent handleRequest()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/CreateCollectionHandler.java
25 4 2
export function register()
in frontend/src/serviceWorker.ts
25 5 1
function checkValidServiceWorker()
in frontend/src/serviceWorker.ts
25 4 2
def lambda_handler()
in python-app-backend/lambda/create-collection/main.py
23 4 2
public IndexFacesResponse handleRequest()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/IndexImageHandler.java
23 3 2
public FrontendInfrastructureStack()
in frontend-infrastructure/src/main/java/com/recognise/FrontendInfrastructureStack.java
23 3 3
public static void main()
in frontend-infrastructure/src/main/java/com/recognise/FrontendInfrastructureApp.java
22 1 1
def lambda_handler()
in python-app-backend/lambda/image-index/main.py
17 4 2
private List faceSearch()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/RecognizeImageHandler.java
15 2 1
private void updateIndexDetails()
in java-app-backend/BackendFunction/src/main/java/com/webapp/function/IndexImageHandler.java
15 1 2