fix problems reported by sonar scanner
Change-Id: Ic351745aed9d670c51a33a21c5c0b5cde77a0e0e
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 2df7b5f..540fb42 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -326,7 +326,6 @@
var data = [];
var severityCode = '';
var priority = '';
- var resolved = false;
var relatedItems = [];
for(var key in content.data){
diff --git a/app/common/services/apiInterceptor.js b/app/common/services/apiInterceptor.js
index bd4743a..0b2f705 100644
--- a/app/common/services/apiInterceptor.js
+++ b/app/common/services/apiInterceptor.js
@@ -29,7 +29,7 @@
}
dataService.last_updated = new Date();
- if(response == null){
+ if(!response){
dataService.server_unreachable = true;
}else{
dataService.server_unreachable = false;
diff --git a/app/server-control/controllers/power-operations-controller.js b/app/server-control/controllers/power-operations-controller.js
index 4e66f56..4ab765d 100644
--- a/app/server-control/controllers/power-operations-controller.js
+++ b/app/server-control/controllers/power-operations-controller.js
@@ -68,7 +68,6 @@
//@TODO:show error message
}
});
- }else{
}
});
};
diff --git a/app/server-health/controllers/log-controller.js b/app/server-health/controllers/log-controller.js
index 59ebd01..eb4ea26 100644
--- a/app/server-health/controllers/log-controller.js
+++ b/app/server-health/controllers/log-controller.js
@@ -9,7 +9,6 @@
window.angular && (function (angular) {
'use strict';
- var logData = [], originalData = {};
angular
.module('app.serverHealth')
.controller('logController', [
@@ -41,8 +40,6 @@
$scope.loadLogs = function(){
APIUtils.getLogs(function(data, originalData){
- logData = data;
- originalData = originalData;
$scope.logs = data;
$scope.originalData = originalData;
});
@@ -81,7 +78,6 @@
$scope.filterBySearchTerms = function(log){
if(!$scope.searchItems.length) return true;
- var flag = false;
for(var i = 0, length = $scope.searchItems.length; i < length; i++){
if(log.search_text.indexOf($scope.searchItems[i].toLowerCase()) == -1) return false;
}
diff --git a/app/server-health/controllers/sensors-controller.js b/app/server-health/controllers/sensors-controller.js
index cf10541..307a451 100644
--- a/app/server-health/controllers/sensors-controller.js
+++ b/app/server-health/controllers/sensors-controller.js
@@ -9,7 +9,7 @@
window.angular && (function (angular) {
'use strict';
- var sensorData = [], originalData = {};
+ var sensorData = [];
angular
.module('app.overview')
.controller('sensorsController', [
diff --git a/app/server-health/controllers/sensors-overview-controller.js b/app/server-health/controllers/sensors-overview-controller.js
index 1e53829..213a4e3 100644
--- a/app/server-health/controllers/sensors-overview-controller.js
+++ b/app/server-health/controllers/sensors-overview-controller.js
@@ -9,7 +9,6 @@
window.angular && (function (angular) {
'use strict';
- var sensorData = [], originalData = {};
angular
.module('app.overview')
.controller('sensorsOverviewController', [
@@ -109,11 +108,9 @@
$scope.loadSensorData = function(){
APIUtils.getAllSensorStatus(function(data, originalData){
- sensorData = data;
- originalData = originalData;
$scope.data = data;
$scope.originalData = originalData;
- dataService.sensorData = sensorData;
+ dataService.sensorData = data;
$scope.export_data = JSON.stringify(originalData);
});
};
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000..bcaa552
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,15 @@
+# Required metadata
+sonar.projectKey=OpenBMC-GUI
+sonar.projectName=OpenBMC-GUI
+sonar.projectVersion=0.0.1
+
+# Comma-separated paths to directories with sources (required)
+sonar.sources=app
+
+sonar.exclusions=app/vendors/**/*.js
+
+# Language
+sonar.language=js
+
+# Encoding of the source files
+sonar.sourceEncoding=UTF-8