aws-samples / amazon-ivs-virtual-qa-web-demo
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 48 units with 898 lines of code in units (31.2% of code).
    • 1 very long units (102 lines of code)
    • 3 long units (247 lines of code)
    • 7 medium size units (214 lines of code)
    • 11 small units (172 lines of code)
    • 26 very small units (163 lines of code)
11% | 27% | 23% | 19% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py27% | 0% | 16% | 26% | 29%
js0% | 46% | 29% | 13% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend/lambda/question-service75% | 0% | 0% | 13% | 11%
frontend/src/addQuestion0% | 79% | 20% | 0% | 0%
frontend/src/auth0% | 58% | 16% | 15% | 9%
frontend/src/questionList0% | 71% | 0% | 28% | 0%
frontend/src/player0% | 0% | 91% | 0% | 8%
backend/lambda/vote-service0% | 0% | 86% | 0% | 13%
frontend/src0% | 0% | 78% | 0% | 21%
backend/lambda/websocket-service0% | 0% | 100% | 0% | 0%
backend/lambda/vote-stream0% | 0% | 0% | 92% | 7%
frontend/src/providers0% | 0% | 0% | 63% | 36%
backend/lambda/question-stream0% | 0% | 0% | 26% | 73%
backend/lambda/connection-stream0% | 0% | 0% | 30% | 69%
frontend/src/util0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambdaHandler()
in backend/lambda/question-service/lambda.py
102 16 2
function AddQuestionModal()
in frontend/src/addQuestion/AddQuestionModal.js
99 5 1
function SignInModal()
in frontend/src/auth/SignInModal.js
76 2 1
function VoteButton()
in frontend/src/questionList/Question/VoteButton.js
72 12 4
function Player()
in frontend/src/player/Player.js
46 2 0
def lambdaHandler()
in backend/lambda/vote-service/lambda.py
38 7 2
setupWebSocket()
in frontend/src/WebSocketClient.js
30 4 1
function CurrentQuestion()
in frontend/src/player/CurrentQuestion.js
30 3 0
function AddQuestionButton()
in frontend/src/addQuestion/AddQuestionButton.js
26 3 0
async function fetchSetUserInfoVotes()
in frontend/src/auth/SignInButton.js
22 2 4
def lambdaHandler()
in backend/lambda/websocket-service/lambda.py
22 4 2
async function setAuthListeners()
in frontend/src/auth/SignInButton.js
20 3 0
def processRecords()
in backend/lambda/vote-stream/lambda.py
19 9 1
def updateQuestionCurrentAnswered()
in backend/lambda/question-service/lambda.py
19 1 4
function QuestionList()
in frontend/src/questionList/QuestionList.js
18 2 0
def updateQuestionVoteCounts()
in backend/lambda/vote-stream/lambda.py
18 4 1
def sendRecordsToConnections()
in backend/lambda/question-stream/lambda.py
17 5 2
def sendQuestionsToConnections()
in backend/lambda/connection-stream/lambda.py
16 4 2
question: pickQuestionProperties()
in frontend/src/providers/QuestionProvider.js
12 3 1
question: pickQuestionProperties()
in frontend/src/providers/QuestionProvider.js
11 3 1