aws-samples / aws-lex-web-ui
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 230 units with 3,248 lines of code in units (30.3% of code).
    • 1 very long units (129 lines of code)
    • 5 long units (325 lines of code)
    • 42 medium size units (1,300 lines of code)
    • 53 small units (787 lines of code)
    • 129 very small units (707 lines of code)
3% | 10% | 40% | 24% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js5% | 13% | 30% | 25% | 25%
py0% | 0% | 66% | 21% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lex-web-ui/src6% | 9% | 32% | 24% | 26%
lex-web-ui0% | 49% | 33% | 11% | 5%
src/initiate-chat-lambda0% | 64% | 0% | 35% | 0%
templates/custom-resources0% | 0% | 66% | 21% | 11%
src/lex-web-ui-loader0% | 0% | 0% | 48% | 51%
config/utils0% | 0% | 0% | 100% | 0%
config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
postTextMessage()
in lex-web-ui/src/store/actions.js
129 44 2
initLiveChatSession()
in lex-web-ui/src/store/actions.js
80 6 1
function chainWebpackLib()
in lex-web-ui/vue.config.js
72 6 6
postText()
in lex-web-ui/src/lib/lex/client.js
61 10 3
function startChatContact()
in src/initiate-chat-lambda/index.js
59 13 1
constructor()
in lex-web-ui/src/lex-web-ui.js
53 27 1
_initStream()
in lex-web-ui/src/lib/lex/recorder.js
45 2 0
initOptions()
in lex-web-ui/src/lib/lex/recorder.js
43 21 1
function downsampleTrimBuffer()
in lex-web-ui/src/lib/lex/wav-worker.js
43 8 2
playAudioInterruptHandler()
in lex-web-ui/src/store/actions.js
43 14 1
def handler()
in templates/custom-resources/lex-manager.py
42 8 2
_initMicVolumeProcessor()
in lex-web-ui/src/lib/lex/recorder.js
42 7 0
sendMessageToParentWindow()
in lex-web-ui/src/store/actions.js
41 7 2
lexPostContent()
in lex-web-ui/src/store/actions.js
40 2 3
def handler()
in templates/custom-resources/codebuild-start.py
38 3 2
def add_prefix()
in templates/custom-resources/lex-manager.py
37 3 2
updateLexState()
in lex-web-ui/src/store/actions.js
37 7 2
def _import_slot_types()
in templates/custom-resources/lexutils.py
35 6 1
interruptSpeechConversation()
in lex-web-ui/src/store/actions.js
35 6 1
def get_parsed_args()
in templates/custom-resources/lex-manager.py
34 2 0