aws-solutions / liveness-detection-framework
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 97 units with 1,218 lines of code in units (37.9% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (233 lines of code)
    • 12 medium size units (358 lines of code)
    • 21 small units (310 lines of code)
    • 61 very small units (317 lines of code)
0% | 19% | 29% | 25% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 27% | 29% | 24% | 18%
tsx0% | 31% | 30% | 18% | 19%
ts0% | 0% | 28% | 31% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/backend/chalicelib0% | 27% | 29% | 24% | 18%
source/client/src/liveness/pose0% | 49% | 14% | 10% | 25%
source/client/src/liveness/nose0% | 0% | 38% | 29% | 32%
source/client/src/liveness/utils0% | 0% | 22% | 40% | 36%
source/client/src/liveness/components0% | 0% | 43% | 21% | 35%
source/client/src/liveness0% | 0% | 100% | 0% | 0%
source/backend0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in source/client/src/liveness/pose/PoseChallenge.tsx
96 5 0
def nose_state()
in source/backend/chalicelib/nose.py
77 23 3
def verify_challenge_response()
in source/backend/chalicelib/framework.py
60 10 1
render()
in source/client/src/liveness/nose/NoseChallenge.tsx
46 7 0
def put_challenge_frame()
in source/backend/chalicelib/framework.py
43 7 1
private processDetectionResults()
in source/client/src/liveness/nose/NoseChallengeProcessor.ts
42 7 1
def first_state()
in source/backend/chalicelib/pose.py
30 6 3
faceImage.onload = function()
in source/client/src/liveness/pose/FacePose.ts
28 1 0
static loadMediaStream()
in source/client/src/liveness/utils/MediaUtils.ts
26 2 1
render()
in source/client/src/liveness/components/ResultMessage.tsx
25 6 0
def challenge_state()
in source/backend/chalicelib/framework.py
25 9 4
constructor()
in source/client/src/liveness/LivenessDetection.tsx
24 2 1
def area_state()
in source/backend/chalicelib/nose.py
24 5 3
def create_challenge()
in source/backend/chalicelib/framework.py
23 5 0
static async putChallengeFrame()
in source/client/src/liveness/utils/APIUtils.ts
22 1 4
endChallenge()
in source/client/src/liveness/pose/PoseChallenge.tsx
20 1 0
public static takePhoto()
in source/client/src/liveness/utils/CanvasUtils.ts
19 2 5
static async startChallenge()
in source/client/src/liveness/utils/APIUtils.ts
19 2 1
private process()
in source/client/src/liveness/nose/NoseChallengeProcessor.ts
19 4 0
def nose_challenge_params()
in source/backend/chalicelib/nose.py
18 1 1