aws-samples / aws-end-to-end-iot-amplify-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 12 units with 158 lines of code in units (12.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (106 lines of code)
    • 1 small units (11 lines of code)
    • 7 very small units (41 lines of code)
0% | 0% | 67% | 6% | 25%
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% | 72% | 9% | 18%
cpp0% | 0% | 55% | 0% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amplify_code/src0% | 0% | 72% | 9% | 18%
iot_code/DemoProject/src0% | 0% | 55% | 0% | 44%
Alternative Visuals
Longest Units
Top 12 longest units
Unit# linesMcCabe index# params
function registerValidSW()
in amplify_code/src/serviceWorker.js
33 8 2
void connectAWS()
in iot_code/DemoProject/src/main.cpp
26 4 0
function checkValidServiceWorker()
in amplify_code/src/serviceWorker.js
25 4 2
export function register()
in amplify_code/src/serviceWorker.js
22 5 1
export function unregister()
in amplify_code/src/serviceWorker.js
11 2 0
async function SendMessage()
in amplify_code/src/App.js
10 1 0
async function ProcessMessage()
in amplify_code/src/App.js
9 1 1
void publishMessage()
in iot_code/DemoProject/src/main.cpp
9 1 0
void loop()
in iot_code/DemoProject/src/main.cpp
5 1 0
void setup()
in iot_code/DemoProject/src/main.cpp
4 1 0
void messageHandler()
in iot_code/DemoProject/src/main.cpp
3 1 2
New messages from your device()
in amplify_code/src/App.js
1 1 1