awslabs / aws-saas-boost
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 1,081 units with 16,621 lines of code in units (42.5% of code).
    • 22 very long units (3,174 lines of code)
    • 44 long units (2,981 lines of code)
    • 173 medium size units (5,341 lines of code)
    • 146 small units (2,252 lines of code)
    • 696 very small units (2,873 lines of code)
19% | 17% | 32% | 13% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java17% | 16% | 36% | 10% | 19%
js21% | 24% | 21% | 22% | 10%
py54% | 0% | 0% | 24% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
client/web21% | 24% | 21% | 22% | 10%
services/onboarding-service54% | 15% | 19% | 5% | 5%
resources/custom-resources39% | 10% | 31% | 5% | 12%
installer/src17% | 28% | 32% | 8% | 12%
functions/onboarding-notification72% | 0% | 15% | 10% | 1%
services/metric-service10% | 11% | 41% | 9% | 26%
metrics-analytics/deploy91% | 0% | 0% | 0% | 8%
services/tenant-service11% | 14% | 46% | 12% | 15%
services/settings-service5% | 14% | 33% | 13% | 33%
metering-billing/lambdas0% | 18% | 55% | 11% | 14%
functions/alb-update0% | 79% | 12% | 8% | 0%
functions/ecs-deploy0% | 63% | 0% | 21% | 14%
functions/ecs-startup-services0% | 50% | 49% | 0% | 0%
services/user-service0% | 0% | 62% | 14% | 23%
services/quotas-service0% | 0% | 62% | 25% | 12%
layers/apigw-helper0% | 0% | 51% | 0% | 48%
functions/ecs-shutdown-services0% | 0% | 100% | 0% | 0%
functions/ecs-service-update0% | 0% | 64% | 24% | 10%
layers/utils0% | 0% | 27% | 19% | 53%
metrics-analytics/metrics-java-sdk0% | 0% | 0% | 13% | 86%
functions/system-rest-api-client0% | 0% | 0% | 37% | 62%
metrics-analytics/metrics-generator0% | 0% | 0% | 50% | 50%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public APIGatewayProxyResponseEvent provisionTenant()
in services/onboarding-service/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/OnboardingService.java
351 46 2
export function ApplicationComponent()
in client/web/src/settings/ApplicationComponent.js
226 25 1
public Object handleRequest()
in functions/onboarding-notification/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/OnboardingNotification.java
221 47 2
public APIGatewayProxyResponseEvent startOnboarding()
in services/onboarding-service/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/OnboardingService.java
202 31 2
public APIGatewayProxyResponseEvent updateProvisionedTenant()
in services/onboarding-service/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/OnboardingService.java
147 15 2
public APIGatewayProxyResponseEvent statusEventListener()
in services/onboarding-service/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/OnboardingService.java
143 31 2
public Object handleRequest()
in resources/custom-resources/rds-options/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/RdsOptions.java
140 20 2
export default function RequestCountFailuresContainer()
in client/web/src/metrics/RequestCountFailuresContainer.js
135 4 1
export default function RequestCountFailuresContainer()
in client/web/src/metrics/RequestCountFailures5XXContainer.js
135 4 1
export default function StatsGraphContainer()
in client/web/src/metrics/StatsGraphContainer.js
129 4 1
public Object handleRequest()
in resources/custom-resources/clear-s3-bucket/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/ClearS3Bucket.java
123 16 2
public Object handleRequest()
in resources/custom-resources/redshift-table/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/RedshiftTable.java
122 18 2
public List queryMetrics()
in services/metric-service/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/MetricServiceDAL.java
119 19 1
public Object handleRequest()
in resources/custom-resources/rds-bootstrap/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/RdsBootstrap.java
115 20 2
protected void installSaaSBoost()
in installer/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/SaaSBoostInstall.java
112 15 0
protected void installAnalyticsModule()
in installer/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/SaaSBoostInstall.java
112 12 0
def SetupQuicksight()
in metrics-analytics/deploy/setup-s3-quicksight.py
111 1 10
export default function MetricTopTenantsContainer()
in client/web/src/metrics/MetricTopTenantsContainer.js
110 5 1
export default function RequestGraphContainer()
in client/web/src/metrics/RequestGraphContainer.js
108 3 1
protected String buildAndCopyWebApp()
in installer/src/main/java/com/amazon/aws/partners/saasfactory/saasboost/SaaSBoostInstall.java
106 15 0