aws-samples / aws-appsync-iot-core-realtime-dashboard
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 33 units with 341 lines of code in units (17.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 2 medium size units (57 lines of code)
    • 8 small units (100 lines of code)
    • 22 very small units (121 lines of code)
0% | 18% | 16% | 29% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 47% | 42% | 0% | 9%
ts0% | 0% | 0% | 43% | 56%
tsx0% | 0% | 0% | 71% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sensor0% | 47% | 42% | 0% | 9%
web/src/graphql0% | 0% | 0% | 43% | 56%
web/src/pages/MapPage0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function createSensors()
in sensor/create-sensors.js
63 2 0
async function deleteSensors()
in sensor/delete-sensors.js
34 2 0
async function run()
in sensor/index.js
23 1 1
listSensorValues()
in web/src/graphql/queries.ts
15 1 3
async function initializeMap()
in web/src/pages/MapPage/index.tsx
13 1 0
onCreateSensorValue()
in web/src/graphql/subscriptions.ts
12 1 1
getSensorValue()
in web/src/graphql/queries.ts
12 1 1
createSensorValue()
in web/src/graphql/mutations.ts
12 1 2
updateSensorValue()
in web/src/graphql/mutations.ts
12 1 2
deleteSensorValue()
in web/src/graphql/mutations.ts
12 1 2
async function DisplaySensors()
in web/src/pages/MapPage/index.tsx
12 2 1
getSensor()
in web/src/graphql/queries.ts
10 1 1
listTodos()
in web/src/graphql/queries.ts
10 1 3
setInterval()
in sensor/index.js
10 1 1
getTodo()
in web/src/graphql/queries.ts
7 1 1
createTodo()
in web/src/graphql/mutations.ts
7 1 2
updateTodo()
in web/src/graphql/mutations.ts
7 1 2
deleteTodo()
in web/src/graphql/mutations.ts
7 1 2
function sensorClicked()
in web/src/pages/MapPage/index.tsx
7 2 1
query ListTodos()
in web/src/graphql/queries.ts
6 1 1