awslabs / aws-api-gateway-developer-portal
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 304 units with 3,022 lines of code in units (28.9% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (288 lines of code)
    • 22 medium size units (606 lines of code)
    • 78 small units (1,099 lines of code)
    • 199 very small units (1,029 lines of code)
0% | 9% | 20% | 36% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 9% | 20% | 36% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambdas/static-asset-uploader0% | 12% | 20% | 35% | 31%
dev-portal/public0% | 14% | 12% | 41% | 31%
scripts/internal0% | 35% | 0% | 35% | 28%
lambdas/catalog-updater0% | 0% | 80% | 14% | 4%
lambdas/user-group-importer0% | 0% | 51% | 19% | 28%
dev-portal/src0% | 0% | 19% | 48% | 32%
scripts0% | 0% | 14% | 17% | 67%
lambdas/user-group-exporter-v30% | 0% | 39% | 38% | 21%
lambdas0% | 0% | 28% | 53% | 17%
lambdas/listener0% | 0% | 0% | 100% | 0%
lambdas/cfn-cognito-user-pools-domain0% | 0% | 0% | 50% | 50%
lambdas/backend0% | 0% | 0% | 0% | 100%
lambdas/cloudfront-security0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
awsSigV4Client.makeRequest = function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/sigV4Client.js
59 14 1
apigClientFactory.newClient = function()
in dev-portal/public/apigateway-js-sdk/apigClient.js
59 13 1
awsSigV4Client.makeRequest = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/apiGatewayCore/sigV4Client.js
59 14 1
apigClientFactory.newClient = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/apigClient.js
59 13 1
function supportsColor()
in scripts/internal/supports-color.js
52 22 1
async function handler()
in lambdas/catalog-updater/index.js
45 6 2
for await()
in lambdas/user-group-importer/index.js
41 7 2
async function getSwaggerFile()
in lambdas/catalog-updater/index.js
36 5 1
simpleHttpClient.makeRequest = function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/simpleHttpClient.js
35 7 1
simpleHttpClient.makeRequest = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/apiGatewayCore/simpleHttpClient.js
35 7 1
35 13 2
async function processUser()
in lambdas/user-group-exporter-v3/index.js
29 8 1
function readMigrateLines()
in lambdas/user-group-importer/index.js
29 4 2
function bindMock()
in lambdas/setup-jest.js
26 8 0
async waitForUpload()
in lambdas/static-asset-uploader/index.js
25 3 3
async handler()
in lambdas/static-asset-uploader/index.js
25 5 0
function setCredentials()
in dev-portal/src/services/self.js
24 3 0
export function login()
in dev-portal/src/services/self.js
23 4 0
stringify: function()
in dev-portal/public/apigateway-js-sdk/lib/CryptoJS/components/enc-base64.js
23 6 1
stringify: function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/CryptoJS/components/enc-base64.js
23 6 1