aws-samples / aws-simple-streaming-webapp
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 14 units with 428 lines of code in units (24.2% of code).
    • 1 very long units (328 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (32 lines of code)
    • 11 very small units (68 lines of code)
76% | 0% | 0% | 7% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js93% | 0% | 0% | 0% | 6%
py0% | 0% | 0% | 42% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend/src/components99% | 0% | 0% | 0% | <1%
backend0% | 0% | 0% | 42% | 57%
frontend/src/components/player0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
function Streampage()
in frontend/src/components/stream.js
328 22 1
def get_values()
in backend/lambda_function.py
18 6 0
def lambda_handler()
in backend/lambda_function.py
14 7 2
def set_default_values()
in backend/lambda_function.py
10 1 4
def update_values()
in backend/lambda_function.py
10 1 4
def set_new_server()
in backend/lambda_function.py
9 11 4
def get_public_ip()
in backend/lambda_function.py
8 1 1
def set_to_replace()
in backend/lambda_function.py
7 11 4
componentDidMount()
in frontend/src/components/player/player.js
5 1 0
componentWillUnmount()
in frontend/src/components/player/player.js
5 2 0
render()
in frontend/src/components/player/player.js
5 1 0
videojs.Hls.xhr.beforeRequest = function()
in frontend/src/components/player/player.js
4 1 1
constructor()
in frontend/src/components/player/player.js
3 1 1
await sleep()
in frontend/src/components/stream.js
2 1 1