aws-samples / aws-ekyc-sample
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 130 units with 3,115 lines of code in units (42.1% of code).
    • 5 very long units (707 lines of code)
    • 8 long units (520 lines of code)
    • 32 medium size units (1,061 lines of code)
    • 30 small units (453 lines of code)
    • 55 very small units (374 lines of code)
22% | 16% | 34% | 14% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts60% | 21% | 15% | 1% | 1%
cs6% | 14% | 43% | 20% | 15%
tsx0% | 0% | 0% | 25% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infra/resources64% | 23% | 10% | 1% | 0%
packages/ekyc-api/src7% | 13% | 39% | 22% | 17%
packages/lambdas/GroundTruthJobHandler0% | 76% | 0% | 23% | 0%
packages/lambdas/CheckRekognitionProject0% | 0% | 100% | 0% | 0%
infra/lib0% | 0% | 100% | 0% | 0%
packages/Base64Encoder0% | 0% | 100% | 0% | 0%
packages/ui/src0% | 0% | 0% | 25% | 75%
packages/PostDeploymentScripts/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in infra/resources/identity.ts
178 1 3
constructor()
in infra/resources/api.ts
155 2 3
public async Task StartLabellingJob()
in packages/ekyc-api/src/ekyc-api/Controllers/TrainingController.cs
131 8 1
constructor()
in infra/resources/storage.ts
126 1 2
private createWAF()
in infra/resources/api.ts
117 2 1
constructor()
in infra/resources/events.ts
86 3 3
public async Task CreateNewSession()
in packages/ekyc-api/src/ekyc-api/Utils/SessionManager.cs
74 7 1
constructor()
in infra/resources/cloudfront-web-acl.ts
72 1 3
public async Task VerifyImageLiveness()
in packages/ekyc-api/src/ekyc-api/Utils/LivenessChecker.cs
66 20 1
private async Task ProcessArn()
in packages/lambdas/GroundTruthJobHandler/src/GroundTruthJobHandler/Function.cs
64 3 1
public void ConfigureServices()
in packages/ekyc-api/src/ekyc-api/Startup.cs
55 1 1
public async Task GetDocumentType()
in packages/ekyc-api/src/ekyc-api/DocumentDefinitions/RekognitionDocumentChecker.cs
52 8 1
constructor()
in infra/resources/webapp.ts
51 1 3
public async Task GetFieldValues()
in packages/ekyc-api/src/ekyc-api/Controllers/DataController.cs
50 10 1
constructor()
in infra/lib/infra-stack.ts
49 1 3
public async Task SubmitSelfie()
in packages/ekyc-api/src/ekyc-api/Controllers/SessionController.cs
49 11 2
public async Task SubmitDocumentForVerification()
in packages/ekyc-api/src/ekyc-api/Controllers/SessionController.cs
45 10 3
private static void Main()
in packages/Base64Encoder/Program.cs
44 8 1
private async Task CompareFacialLandmarks()
in packages/ekyc-api/src/ekyc-api/Utils/LivenessChecker.cs
41 16 3
public async Task VerifyLiveness()
in packages/ekyc-api/src/ekyc-api/Controllers/LivenessController.cs
41 7 1