diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 019fca48..71bef0b4 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ - Add: check response obj before use it handling http commands - Upgrade NodeJS version from 8.16.1 to 10.17.0 in Dockerfile due to Node 8 End-of-Life +- Hardening: software quality improvement based on ISO25010 recommendations \ No newline at end of file diff --git a/lib/bindings/HTTPBindings.js b/lib/bindings/HTTPBindings.js index 89bf31b7..e4813f3b 100644 --- a/lib/bindings/HTTPBindings.js +++ b/lib/bindings/HTTPBindings.js @@ -57,6 +57,7 @@ function handleError(error, req, res, next) { name: error.name, message: error.message }); + next(); } function parseData(req, res, next) { @@ -203,6 +204,7 @@ function returnCommands(req, res, next) { } else { res.status(200).send(''); } + next(); } function handleIncomingMeasure(req, res, next) { diff --git a/lib/bindings/MQTTBinding.js b/lib/bindings/MQTTBinding.js index 1b81840f..645c9512 100644 --- a/lib/bindings/MQTTBinding.js +++ b/lib/bindings/MQTTBinding.js @@ -278,7 +278,7 @@ function start(callback) { } }); mqttClient.on('message', commonBindings.mqttMessageHandler); - mqttClient.on('connect', function(ack) { + mqttClient.on('connect', function() { config.getLogger().info(context, 'MQTT Client connected'); recreateSubscriptions(); }); diff --git a/lib/commonBindings.js b/lib/commonBindings.js index 7bebe31f..bd8b0376 100644 --- a/lib/commonBindings.js +++ b/lib/commonBindings.js @@ -112,10 +112,9 @@ function manageConfigurationRequest(apiKey, deviceId, device, objMessage) { * @param {String} apikey APIKey of the service the device belongs to. * @param {Array} previous Array of prepared functions that send information to the Context Broker. * @param {Object} current Information sent by the device. - * @param {Number} index Index of the group in the array. * @return {Array} Updated array of functions. */ -function processMeasureGroup(device, apikey, previous, current, index) { +function processMeasureGroup(device, apikey, previous, current) { var values = []; if (current.command) { diff --git a/lib/iotaUtils.js b/lib/iotaUtils.js index eb0afe49..103ea72f 100644 --- a/lib/iotaUtils.js +++ b/lib/iotaUtils.js @@ -154,6 +154,10 @@ function mergeDeviceWithConfiguration(deviceData, configuration, callback) { deviceData[fields[i]] = configuration[confField]; } else if (!deviceData[fields[i]] && (!configuration || !configuration[confField])) { deviceData[fields[i]] = defaults[i]; + } else { + config + .getLogger() + .debug(context, 'at field "' + fields[i] + '" configuration merging logic did not merge anything'); } if (deviceData[fields[i]] && ['active', 'lazy', 'commands'].indexOf(fields[i]) >= 0) {