aws-samples / aws-appsync-iot-core-realtime-example
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 28 units with 279 lines of code in units (26.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 2 medium size units (72 lines of code)
    • 2 small units (31 lines of code)
    • 23 very small units (125 lines of code)
0% | 18% | 25% | 11% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 27% | 17% | 6% | 48%
java0% | 0% | 48% | 23% | 27%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sensor0% | 56% | 36% | 0% | 7%
mobile/android/app0% | 0% | 48% | 23% | 27%
mobile/src/graphql0% | 0% | 0% | 13% | 86%
mobile/ios/mobile0% | 0% | 0% | 0% | 100%
mobile0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function createSensor()
in sensor/create-sensor.js
51 2 0
public static void initializeFlipper()
in mobile/android/app/src/debug/java/com/mobile/ReactNativeFlipper.java
39 3 2
async function deleteSensor()
in sensor/delete-sensor.js
33 2 0
private static void initializeFlipper()
in mobile/android/app/src/main/java/com/mobile/MainApplication.java
19 6 2
listSensorValues()
in mobile/src/graphql/queries.js
12 1 3
onCreateSensorValue()
in mobile/src/graphql/subscriptions.js
9 1 1
createSensorValue()
in mobile/src/graphql/mutations.js
9 1 2
updateSensorValue()
in mobile/src/graphql/mutations.js
9 1 2
deleteSensorValue()
in mobile/src/graphql/mutations.js
9 1 2
getSensorValue()
in mobile/src/graphql/queries.js
9 1 1
static void InitializeFlipper()
in mobile/ios/mobile/AppDelegate.m
9 1 1
setInterval()
in sensor/index.js
7 1 1
query ListSensorValues()
in mobile/src/graphql/queries.js
6 1 1
getTransformOptions: async()
in mobile/metro.config.js
6 1 0
protected List getPackages()
in mobile/android/app/src/main/java/com/mobile/MainApplication.java
5 1 0
public void onCreate()
in mobile/android/app/src/main/java/com/mobile/MainApplication.java
5 1 0
mutation CreateSensorValue()
in mobile/src/graphql/mutations.js
5 1 1
mutation UpdateSensorValue()
in mobile/src/graphql/mutations.js
5 1 1
mutation DeleteSensorValue()
in mobile/src/graphql/mutations.js
5 1 1
int main()
in mobile/ios/mobile/main.m
5 1 2