aws-solutions / aws-connected-vehicle-solution
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 89 units with 1,958 lines of code in units (61.1% of code).
    • 1 very long units (103 lines of code)
    • 6 long units (409 lines of code)
    • 24 medium size units (815 lines of code)
    • 28 small units (432 lines of code)
    • 30 very small units (199 lines of code)
5% | 20% | 41% | 22% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js5% | 20% | 41% | 22% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/helper28% | 0% | 50% | 13% | 7%
services/vehicle0% | 31% | 57% | 8% | 2%
services/jitr0% | 100% | 0% | 0% | 0%
services/anomaly0% | 26% | 34% | 20% | 18%
services/marketing0% | 30% | 0% | 35% | 33%
services/dtc0% | 0% | 41% | 43% | 14%
services/notification0% | 0% | 58% | 40% | 1%
services/driversafety0% | 0% | 0% | 70% | 29%
data-loaders/dtc-generator0% | 0% | 0% | 74% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
kinesisHelper.prototype.createKinesisAnalyticsApp = function()
in source/resources/helper/lib/kinesis-helper.js
103 6 2
exports.handler = function()
in source/services/jitr/index.js
92 8 3
function processRequest()
in source/services/vehicle/lib/index.js
88 28 2
anomaly.prototype.createAnomaly = function()
in source/services/anomaly/lib/anomaly.js
61 6 2
anomaly.prototype.acknowledgeVehicleAnomaly = function()
in source/services/vehicle/lib/anomaly.js
58 6 4
dtc.prototype.acknowledgeVehicleDtc = function()
in source/services/vehicle/lib/dtc.js
58 6 4
let processAd = function()
in source/services/marketing/lib/marketing.js
52 6 3
anomaly.prototype.getVehicleAnomaly = function()
in source/services/vehicle/lib/anomaly.js
47 5 4
healthreport.prototype.getVehicleHealthReport = function()
in source/services/vehicle/lib/healthreport.js
47 5 4
trip.prototype.getVehicleTrip = function()
in source/services/vehicle/lib/trip.js
47 5 4
dtc.prototype.getVehicleDtc = function()
in source/services/vehicle/lib/dtc.js
47 5 4
anomaly.prototype.listAnomaliesByVehicle = function()
in source/services/vehicle/lib/anomaly.js
39 4 3
healthreport.prototype.listHealthReportsByVehicle = function()
in source/services/vehicle/lib/healthreport.js
39 4 3
trip.prototype.listTripsByVehicle = function()
in source/services/vehicle/lib/trip.js
39 4 3
dtc.prototype.listDtcByVehicle = function()
in source/services/vehicle/lib/dtc.js
39 4 3
dtc.prototype.updateVehicle = function()
in source/services/dtc/lib/dtc.js
36 4 2
kinesisHelper.prototype.deleteKinesisAnalyticsApp = function()
in source/resources/helper/lib/kinesis-helper.js
35 3 2
dynamoDBHelper.prototype.loadPois = function()
in source/resources/helper/lib/dynamodb-helper.js
34 3 2
let sendResponse = function()
in source/resources/helper/index.js
34 1 5
let getUser = function()
in source/services/notification/lib/notification.js
34 4 2