aws-amplify / amplify-codegen
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 873 units with 15,628 lines of code in units (48.5% of code).
    • 21 very long units (2,812 lines of code)
    • 36 long units (2,322 lines of code)
    • 161 medium size units (5,114 lines of code)
    • 212 small units (3,130 lines of code)
    • 443 very small units (2,250 lines of code)
17% | 14% | 32% | 20% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts20% | 14% | 32% | 18% | 14%
js5% | 16% | 33% | 31% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/graphql-types-generator/fixtures81% | 0% | 4% | <1% | 13%
packages/amplify-codegen-e2e-core/src12% | 14% | 45% | 18% | 7%
packages/appsync-modelgen-plugin/src4% | 17% | 41% | 19% | 17%
packages/amplify-codegen/src8% | 18% | 32% | 32% | 8%
packages/graphql-types-generator/src0% | 21% | 28% | 29% | 20%
scripts0% | 61% | 0% | 10% | 27%
packages/graphql-docs-generator/src0% | 0% | 27% | 41% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function addAuthWithMaxOptions()
in packages/amplify-codegen-e2e-core/src/categories/auth.ts
179 2 2
export function addAuthUserPoolOnly()
in packages/amplify-codegen-e2e-core/src/categories/auth.ts
173 2 2
human()
in packages/graphql-types-generator/fixtures/starwars.service.ts
154 1 1
human()
in packages/graphql-types-generator/fixtures/output.ts
154 1 1
human()
in packages/graphql-types-generator/fixtures/angular.ts
154 1 1
protected generateSerializationMethod()
in packages/appsync-modelgen-plugin/src/visitors/appsync-dart-visitor.ts
152 45 2
droid()
in packages/graphql-types-generator/fixtures/starwars.service.ts
146 1 1
droid()
in packages/graphql-types-generator/fixtures/output.ts
146 1 1
droid()
in packages/graphql-types-generator/fixtures/angular.ts
146 1 1
search()
in packages/graphql-types-generator/fixtures/starwars.service.ts
136 1 1
search()
in packages/graphql-types-generator/fixtures/output.ts
136 1 1
search()
in packages/graphql-types-generator/fixtures/angular.ts
136 1 1
async function add()
in packages/amplify-codegen/src/commands/add.js
119 35 2
export function addAuthIdentityPoolAndUserPoolWithOAuth()
in packages/amplify-codegen-e2e-core/src/categories/auth.ts
111 3 2
hero()
in packages/graphql-types-generator/fixtures/starwars.service.ts
110 1 1
character()
in packages/graphql-types-generator/fixtures/starwars.service.ts
110 1 1
hero()
in packages/graphql-types-generator/fixtures/output.ts
110 1 1
character()
in packages/graphql-types-generator/fixtures/output.ts
110 1 1
hero()
in packages/graphql-types-generator/fixtures/angular.ts
110 1 1
character()
in packages/graphql-types-generator/fixtures/angular.ts
110 1 1