aws-amplify / amplify-js
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 2,345 units with 36,003 lines of code in units (54.7% of code).
    • 23 very long units (3,018 lines of code)
    • 93 long units (6,253 lines of code)
    • 408 medium size units (12,418 lines of code)
    • 515 small units (7,597 lines of code)
    • 1,306 very small units (6,717 lines of code)
8% | 17% | 34% | 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
ts7% | 16% | 35% | 19% | 20%
c24% | 26% | 35% | 10% | 2%
tsx3% | 16% | 35% | 25% | 18%
js5% | 18% | 26% | 26% | 23%
java22% | 0% | 36% | 22% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/amazon-cognito-identity-js17% | 22% | 31% | 19% | 9%
packages/datastore13% | 21% | 33% | 17% | 14%
packages/storage29% | 8% | 28% | 19% | 13%
packages/aws-amplify-react4% | 20% | 33% | 24% | 17%
packages/auth9% | 37% | 32% | 13% | 7%
packages/pushnotification16% | 0% | 43% | 23% | 16%
packages/xr32% | 0% | 0% | 24% | 42%
packages/amplify-ui-components4% | 4% | 40% | 30% | 19%
packages/api-rest35% | 0% | 40% | 0% | 24%
packages/core0% | 20% | 35% | 19% | 23%
packages/aws-amplify-react-native0% | 25% | 32% | 23% | 18%
packages/pubsub0% | 37% | 21% | 19% | 22%
packages/predictions0% | 10% | 47% | 18% | 23%
scripts0% | 51% | 31% | 14% | 3%
packages/analytics0% | 6% | 48% | 24% | 21%
packages/aws-amplify-angular0% | 5% | 29% | 22% | 42%
packages/datastore-storage-adapter0% | 15% | 42% | 26% | 16%
packages/interactions0% | 22% | 49% | 15% | 11%
packages/aws-amplify-vue0% | 10% | 21% | 25% | 43%
packages/geo0% | 0% | 33% | 31% | 35%
packages/aws-amplify0% | 0% | 52% | 36% | 11%
packages/amplify-ui-react0% | 0% | 56% | 0% | 43%
packages/api-graphql0% | 0% | 25% | 15% | 58%
packages/api0% | 0% | 0% | 0% | 100%
packages/amplify-ui-storybook0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int mp_exptmod_fast()
in packages/amazon-cognito-identity-js/ios/JKBigInteger/LibTomMath/tommath.c
205 58 5
int mp_toom_mul()
in packages/amazon-cognito-identity-js/ios/JKBigInteger/LibTomMath/tommath.c
196 60 3
public void sendToNotificationCentre()
in packages/pushnotification/android/src/main/java/com/amazonaws/amplify/pushnotification/modules/RNPushNotificationHelper.java
184 42 1
start()
in packages/datastore/src/sync/index.ts
181 12 1
private async jitteredRetry()
in packages/datastore/src/sync/processors/mutation.ts
168 16 9
int s_mp_exptmod()
in packages/amazon-cognito-identity-js/ios/JKBigInteger/LibTomMath/tommath.c
160 49 5
int mp_div()
in packages/amazon-cognito-identity-js/ios/JKBigInteger/LibTomMath/tommath.c
130 36 4
public put()
in packages/storage/src/providers/AWSS3Provider.ts
125 19 3
authenticateUserDefaultAuth()
in packages/amazon-cognito-identity-js/src/CognitoUser.js
122 14 2
public async get()
in packages/storage/src/providers/AWSS3Provider.ts
121 20 2
public async loadScene()
in packages/xr/src/Providers/SumerianProvider.ts
121 16 3
next: async()
in packages/datastore/src/sync/index.ts
119 14 7
private buildDefaultFormFields()
in packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx
112 4 0
async ajax()
in packages/api-rest/src/RestClient.ts
111 19 3
render()
in packages/aws-amplify-react/src/Auth/Authenticator.tsx
111 12 0
authenticateUserInternal()
in packages/amazon-cognito-identity-js/src/CognitoUser.js
110 15 3
int mp_invmod_slow()
in packages/amazon-cognito-identity-js/ios/JKBigInteger/LibTomMath/tommath.c
110 39 3
static getNamespace()
in packages/datastore/src/sync/index.ts
110 1 0
private async _handleAuthResponse()
in packages/auth/src/Auth.ts
108 19 1
public async get()
in packages/storage/src/providers/AWSS3Provider.ts
107 17 2