aws-samples / aws-cloudwatch-building-dashboard-outside-aws-console
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 8 units with 104 lines of code in units (92.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (25 lines of code)
    • 4 small units (57 lines of code)
    • 3 very small units (22 lines of code)
0% | 0% | 24% | 54% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 24% | 54% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
server0% | 0% | 55% | 44% | 0%
client/src0% | 0% | 0% | 65% | 34%
client/src/views0% | 0% | 0% | 57% | 42%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
25 5 3
getWidget = function()
in server/server.js
20 3 3
function apiHandler()
in client/src/main.js
14 1 2
export function render()
in client/src/views/widget.js
12 2 1
function app()
in client/src/main.js
11 3 1
function arrayBufferToBase64()
in client/src/views/widget.js
9 2 1
request()
in client/src/main.js
7 2 4
function addParams()
in client/src/main.js
6 3 2