aws-amplify / amplify-cli
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 5,259 units with 83,880 lines of code in units (57.1% of code).
    • 50 very long units (8,162 lines of code)
    • 236 long units (16,042 lines of code)
    • 858 medium size units (26,600 lines of code)
    • 1,216 small units (17,783 lines of code)
    • 2,899 very small units (15,293 lines of code)
9% | 19% | 31% | 21% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts8% | 19% | 31% | 20% | 19%
js14% | 16% | 31% | 22% | 15%
tsx28% | 0% | 46% | 12% | 11%
py0% | 40% | 25% | 18% | 15%
go0% | 0% | 100% | 0% | 0%
java0% | 0% | 0% | 20% | 79%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/amplify-provider-awscloudformation14% | 20% | 26% | 23% | 14%
packages/graphql-key-transformer65% | 4% | 15% | 9% | 5%
packages/amplify-category-predictions33% | 10% | 20% | 28% | 5%
packages/amplify-category-auth24% | 24% | 21% | 17% | 10%
packages/amplify-e2e-core10% | 22% | 39% | 19% | 9%
packages/amplify-category-api15% | 22% | 37% | 14% | 9%
packages/amplify-category-interactions38% | 17% | 36% | 5% | 2%
packages/graphql-auth-transformer13% | 32% | 27% | 17% | 8%
packages/amplify-graphql-searchable-transformer19% | 11% | 41% | 17% | 9%
packages/amplify-category-function7% | 28% | 31% | 16% | 16%
packages/amplify-category-analytics28% | 16% | 24% | 22% | 8%
packages/amplify-cli2% | 8% | 39% | 20% | 27%
packages/amplify-dotnet-function-template-provider34% | 37% | 27% | 0% | <1%
packages/amplify-nodejs-function-template-provider37% | 40% | 10% | 11% | 1%
packages/graphql-transformer-common14% | 16% | 7% | 27% | 33%
packages/amplify-category-storage3% | 19% | 30% | 29% | 17%
packages/amplify-graphiql-explorer23% | 0% | 44% | 19% | 11%
packages/graphql-dynamodb-transformer5% | 29% | 32% | 15% | 16%
packages/amplify-graphql-transformer-core4% | 24% | 26% | 15% | 29%
packages/graphql-transformer-core0% | 25% | 29% | 21% | 23%
packages/amplify-graphql-index-transformer0% | 39% | 35% | 16% | 8%
packages/amplify-graphql-model-transformer0% | 56% | 23% | 9% | 11%
packages/amplify-graphql-relational-transformer0% | 35% | 27% | 20% | 16%
packages/amplify-appsync-simulator0% | 12% | 31% | 21% | 34%
packages/graphql-elasticsearch-transformer0% | 32% | 30% | 20% | 16%
packages/amplify-util-mock0% | 12% | 41% | 26% | 19%
packages/amplify-category-notifications0% | 13% | 56% | 15% | 14%
packages/amplify-container-hosting0% | 40% | 25% | 17% | 16%
packages/amplify-app0% | 36% | 25% | 28% | 9%
packages/amplify-graphql-auth-transformer0% | 26% | 22% | 30% | 19%
packages/amplify-frontend-javascript0% | 17% | 37% | 25% | 19%
packages/graphql-mapping-template0% | 15% | 12% | 17% | 54%
packages/amplify-category-hosting0% | 13% | 47% | 26% | 13%
packages/amplify-graphql-predictions-transformer0% | 22% | 12% | 28% | 37%
packages/amplify-category-custom0% | 19% | 35% | 26% | 18%
scripts0% | 44% | 10% | 21% | 24%
packages/amplify-frontend-ios0% | 13% | 39% | 21% | 25%
packages/amplify-frontend-android0% | 13% | 39% | 23% | 24%
packages/amplify-frontend-flutter0% | 13% | 32% | 26% | 28%
packages/amplify-console-hosting0% | 7% | 24% | 35% | 31%
packages/amplify-dynamodb-simulator0% | 44% | 0% | 20% | 34%
packages/amplify-velocity-template0% | 5% | 40% | 25% | 28%
packages/graphql-predictions-transformer0% | 8% | 30% | 30% | 30%
packages/amplify-storage-simulator0% | 15% | 51% | 24% | 8%
packages/amplify-util-uibuilder0% | 26% | 27% | 31% | 15%
packages/amplify-category-xr0% | 14% | 60% | 3% | 21%
packages/amplify-graphql-http-transformer0% | 31% | 0% | 53% | 14%
packages/graphql-http-transformer0% | 0% | 62% | 25% | 12%
packages/graphql-relational-schema-transformer0% | 0% | 40% | 30% | 28%
packages/amplify-cli-core0% | 0% | 27% | 24% | 47%
packages/amplify-category-geo0% | 0% | 31% | 54% | 14%
packages/graphql-connection-transformer0% | 0% | 22% | 28% | 48%
packages/amplify-graphql-transformer-migrator0% | 0% | 21% | 39% | 40%
packages/amplify-python-function-runtime-provider0% | 0% | 62% | 23% | 14%
packages/amplify-go-function-runtime-provider0% | 0% | 100% | 0% | 0%
packages/amplify-nodejs-function-runtime-provider0% | 0% | 54% | 20% | 24%
packages/amplify-graphql-maps-to-transformer0% | 0% | 75% | 0% | 25%
packages/graphql-versioned-transformer0% | 0% | 22% | 50% | 27%
packages/amplify-java-function-runtime-provider0% | 0% | 23% | 29% | 47%
packages/amplify-java-function-template-provider0% | 0% | 100% | 0% | 0%
packages/amplify-cli-logger0% | 0% | 0% | 46% | 53%
packages/amplify-graphql-function-transformer0% | 0% | 0% | 59% | 40%
packages/graphql-function-transformer0% | 0% | 0% | 35% | 64%
packages/amplify-python-function-template-provider0% | 0% | 0% | 100% | 0%
packages/amplify-util-headless-input0% | 0% | 0% | 47% | 52%
packages/amplify-graphql-default-value-transformer0% | 0% | 0% | 40% | 59%
packages/amplify-dotnet-function-runtime-provider0% | 0% | 0% | 100% | 0%
packages/amplify-go-function-template-provider0% | 0% | 0% | 78% | 21%
packages/amplify-prompts0% | 0% | 0% | 78% | 21%
cypress/integration0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function generateLambdaAccessForRekognition()
in packages/amplify-category-predictions/provider-utils/awscloudformation/assets/identifyCFNGenerate.js
343 1 3
version: str()
in packages/graphql-key-transformer/src/KeyTransformer.ts
309 30 1
operation: str()
in packages/graphql-key-transformer/src/KeyTransformer.ts
308 30 1
limit: ref()
in packages/graphql-key-transformer/src/KeyTransformer.ts
307 30 1
query: ref()
in packages/graphql-key-transformer/src/KeyTransformer.ts
306 30 1
async function configure()
in packages/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js
263 27 4
export async function run()
in packages/amplify-provider-awscloudformation/src/push-resources.ts
251 66 3
private alb()
in packages/amplify-category-api/src/provider-utils/awscloudformation/ecs-alb-stack.ts
236 6 0
export async function formNestedStack()
in packages/amplify-provider-awscloudformation/src/push-resources.ts
235 52 7
export function addAuthWithMaxOptions()
in packages/amplify-e2e-core/src/categories/auth.ts
203 7 2
private ecs()
in packages/amplify-category-api/src/provider-utils/awscloudformation/base-api-stack.ts
195 12 0
export async function askEventSourceQuestions()
in packages/amplify-dotnet-function-template-provider/src/utils/eventSourceWalkthrough.ts
190 9 1
export async function askEventSourceQuestions()
in packages/amplify-nodejs-function-template-provider/src/utils/eventSourceWalkthrough.ts
187 9 1
function generateStorageCFNForAdditionalLambda()
in packages/amplify-category-predictions/provider-utils/awscloudformation/assets/identifyCFNGenerate.js
182 2 3
export async function transformGraphQLSchema()
in packages/amplify-provider-awscloudformation/src/graphql-transformer/transform-graphql-schema.ts
175 33 2
async function init()
in packages/amplify-provider-awscloudformation/src/amplify-service-manager.js
169 30 1
export async function transformGraphQLSchema()
in packages/amplify-provider-awscloudformation/src/transform-graphql-schema.ts
161 29 2
export function createParametersStack()
in packages/amplify-graphql-searchable-transformer/src/cdk/create-cfnParameters.ts
159 1 1
export function addAuthUserPoolOnly()
in packages/amplify-e2e-core/src/categories/auth.ts
158 2 2
storeExpressionVals = function()
in packages/amplify-category-function/src/provider-utils/awscloudformation/utils/cronExpression.ts
157 65 3