aws-samples / aws-saas-factory-hybrid-saas-identity
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 100 units with 2,395 lines of code in units (63.1% of code).
    • 4 very long units (756 lines of code)
    • 3 long units (218 lines of code)
    • 26 medium size units (742 lines of code)
    • 34 small units (494 lines of code)
    • 33 very small units (185 lines of code)
31% | 9% | 30% | 20% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts78% | 17% | 3% | 0% | <1%
js0% | 3% | 49% | 34% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/base81% | 12% | 5% | 0% | <1%
lib/tenant72% | 27% | 0% | 0% | 0%
resources/oidc-provider0% | 11% | 51% | 24% | 11%
resources/add_tenant_infra_lambda0% | 0% | 47% | 41% | 11%
resources/add_federation_configuration_lambda0% | 0% | 52% | 39% | 8%
resources/oidc-client0% | 0% | 96% | 0% | 3%
resources/add_ldap_user_group0% | 0% | 100% | 0% | 0%
resources/start_oidc_provider_pipeline_lambda0% | 0% | 0% | 77% | 22%
resources/finish_oidc_provider_pipeline_lambda0% | 0% | 0% | 38% | 61%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in lib/base/tenant-service-stack.ts
325 1 3
constructor()
in lib/tenant/oidc-provider-pipeline-stack.ts
218 1 3
constructor()
in lib/base/oidc-client-stack.ts
111 1 3
constructor()
in lib/base/base-pipeline-stack.ts
102 1 3
constructor()
in lib/tenant/oidc-provider-stack.ts
82 8 3
constructor()
in lib/base/base-stack.ts
82 2 3
async findAccount()
in resources/oidc-provider/account/ldap_auth/index.js
54 3 2
async function createTenantConfig()
in resources/add_tenant_infra_lambda/handler.js
41 3 1
async function createCookieKeysAddToSecrets()
in resources/add_federation_configuration_lambda/handler.js
39 3 1
async authenticate()
in resources/oidc-provider/account/ldap_auth/index.js
39 3 2
async function createIngress()
in resources/add_tenant_infra_lambda/handler.js
36 4 1
async function getsettings()
in resources/oidc-provider/settings.js
36 4 1
constructor()
in lib/base/oidc-resource-stack.ts
35 1 3
async function createJwksAddToSecrets()
in resources/add_federation_configuration_lambda/handler.js
34 3 1
async function addTenantAppClientRecordToOidcProviderTable()
in resources/add_federation_configuration_lambda/handler.js
34 2 4
async function createTenantAuth()
in resources/add_tenant_infra_lambda/handler.js
32 4 1
async function ldapPasswordAddToSecrets()
in resources/add_federation_configuration_lambda/handler.js
32 3 2
async findAccount()
in resources/oidc-provider/account/cognito_auth/index.js
32 4 2
async function getclients()
in resources/oidc-provider/settings.js
31 2 1
async authenticate()
in resources/oidc-provider/account/cognito_auth/index.js
30 2 2