Sonar Issue fixes for js 97/9197/2
authorrb7147 <rb7147@att.com>
Tue, 29 Aug 2017 18:38:54 +0000 (14:38 -0400)
committerrb7147 <rb7147@att.com>
Wed, 30 Aug 2017 12:27:28 +0000 (08:27 -0400)
Resolved POLICY-SDK-APP js blockers and critical issues

Issue-Id: POLICY-184
Change-Id: I2ec99b4d48fcc2f833c6fd6140fed6d926c3fd9e
Signed-off-by: rb7147 <rb7147@att.com>
POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dashboardController.js
POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js
POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
POLICY-SDK-APP/src/main/webapp/app/policyApp/service/userInfoServiceDS2.js

index 7d35211..8771ee9 100644 (file)
@@ -74,17 +74,17 @@ app.controller('policyDashboardHealthController', function ($scope, PolicyAppSer
                console.log("failed");
        });
        
-       $scope.availableGridHealthDatas = {
-                       data : 'systemAlertsTableDatas',
-                           enableFiltering: true,
-                           columnDefs: [{ field: 'id'},
-                             { field: 'type'},
-                             { field: 'system'},
-                             {field: 'logtype'},
-                             {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' },
-                             {field : 'description'}
-                         ],      
-       };
+    $scope.availableGridHealthDatas = {
+               data : 'systemAlertsTableDatas',
+               enableFiltering: true,
+               columnDefs: [{ field: 'id'},
+                       { field: 'type'},
+                       { field: 'system'},
+                       {field: 'logtype'},
+                       {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' },
+                       {field : 'description'}
+                       ]  
+    };
 
        $scope.papStatusDatas = {
                data : 'papTableDatas',
@@ -93,7 +93,7 @@ app.controller('policyDashboardHealthController', function ($scope, PolicyAppSer
                        { field: 'status'},
                        { field: 'noOfPolicy'},
                        {field: 'noOfConnectedTrap'}
-               ],
+               ]
        };
 
        $scope.pdpStatusDatas = {
@@ -107,7 +107,7 @@ app.controller('policyDashboardHealthController', function ($scope, PolicyAppSer
                        {field : 'permitCount'},
                        {field : 'denyCount'},
                        {field : 'naCount'}
-               ],
+               ]
        };
 
        $scope.policyActivityDatas = {
@@ -116,6 +116,6 @@ app.controller('policyDashboardHealthController', function ($scope, PolicyAppSer
                columnDefs: [{ field: 'policyId'},
                        { field: 'fireCount'},
                        { field: 'system'}
-               ],
+               ]
        };
 });
\ No newline at end of file
index d880ac6..1925e5f 100644 (file)
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-app.controller('editFWPrefixListController' ,  function ($scope, $modalInstance, message, Notification, UserInfoServiceDS2, Notification){
+app.controller('editFWPrefixListController' ,  function ($scope, $modalInstance, message, Notification, UserInfoServiceDS2){
        $scope.validate = 'false';
     if(message.prefixListDictionaryData==null)
         $scope.label='Add PrefixList'
index a6fa7b2..b93fc8a 100644 (file)
@@ -234,7 +234,7 @@ angular.module("abs").controller('clFaultController', ['$scope', '$window', 'Pol
                        }
                        if($scope.jsonData.verificationSignaturesUsedForUI != null){
                                if($scope.jsonData.verificationSignaturesUsedForUI.signatures != null){
-                                       $scope.temp.policy.triggerfaultSignatures = {Fault1 : [], Fault2 : [],  Fault3 : [],  Fault4 : [],  Fault5 : [],  Fault6 : [],};
+                                       $scope.temp.policy.triggerfaultSignatures = {Fault1 : [], Fault2 : [],  Fault3 : [],  Fault4 : [],  Fault5 : [],  Fault6 : []};
                                        var splitTraps = $scope.jsonData.verificationSignaturesUsedForUI.signatures.split("#!?!"); 
                                        if(splitTraps.length > 1){
                                                $scope.verificationdisabled = false;
@@ -530,7 +530,7 @@ angular.module("abs").controller('clFaultController', ['$scope', '$window', 'Pol
                }
                if($scope.temp.policy.triggerTrapSignatures.length == 3 || $scope.temp.policy.triggerTrapSignatures["Trap3"] != null){
                        var data = {trap1 : $scope.temp.policy.triggerTrapSignatures.Trap1,  trap2 : $scope.temp.policy.triggerTrapSignatures.Trap2,
-                                       trap2 : $scope.temp.policy.triggerTrapSignatures.Trap3}
+                                       trap3 : $scope.temp.policy.triggerTrapSignatures.Trap3}
                }
                if($scope.temp.policy.triggerTrapSignatures.length == 4 || $scope.temp.policy.triggerTrapSignatures["Trap4"] != null){
                        var data = {trap1 : $scope.temp.policy.triggerTrapSignatures.Trap1,  trap2 : $scope.temp.policy.triggerTrapSignatures.Trap2,
@@ -555,7 +555,7 @@ angular.module("abs").controller('clFaultController', ['$scope', '$window', 'Pol
                }
                if($scope.temp.policy.triggerfaultSignatures.length == 3 || $scope.temp.policy.triggerfaultSignatures["Fault3"] != null){
                        var faultData = {trap1 : $scope.temp.policy.triggerfaultSignatures.Fault1,  trap2 : $scope.temp.policy.triggerfaultSignatures.Fault2,
-                                       trap2 : $scope.temp.policy.triggerfaultSignatures.Fault3}
+                                       trap3 : $scope.temp.policy.triggerfaultSignatures.Fault3}
                }
                if($scope.temp.policy.triggerTrapSignatures.length == 4 || $scope.temp.policy.triggerfaultSignatures["Fault4"] != null){
                        var faultData = {trap1 : $scope.temp.policy.triggerfaultSignatures.Fault1,  trap2 : $scope.temp.policy.triggerfaultSignatures.Fault2,
index 5d81bc1..8dd559c 100644 (file)
@@ -323,25 +323,23 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind
 
                                }
 
-                               if (dictionary!= null || dictionary>1){
-                               if (dictionary!= null || dictionary.length>1){
-                                       for (m=0; m < dictionary.length; m += 1){
-                                               var keyCompare = dictionary[m].name;
-                                               var valueCompare = dictionary[m].value;
-                                               var valueModel = dictionary[m].modelName;
-                                               var conpairService = serviceName;
-                                               if (valueModel.includes('-v')){
-                                                       conpairService = service;
-                                               }
-                                               if(valueModel.localeCompare(conpairService) == 0){
-                                                       console.log(valueCompare);      
-                                                       dictionaryList.push(dictionary[m]);
-                                                       if (!dictionaryNameList.includes(dictionary[m].name)){
-                                                               dictionaryNameList.push(dictionary[m].name)
-                                                       }
-                                               }
-                                       }
-                               }
+                               if (dictionary!= null && dictionary.length>1){
+                                       for (m=0; m < dictionary.length; m += 1){
+                                               var keyCompare = dictionary[m].name;
+                                               var valueCompare = dictionary[m].value;
+                                               var valueModel = dictionary[m].modelName;
+                                               var conpairService = serviceName;
+                                               if (valueModel.includes('-v')){
+                                                       conpairService = service;
+                                               }
+                                               if(valueModel.localeCompare(conpairService) == 0){
+                                                       console.log(valueCompare);      
+                                                       dictionaryList.push(dictionary[m]);
+                                                       if (!dictionaryNameList.includes(dictionary[m].name)){
+                                                               dictionaryNameList.push(dictionary[m].name)
+                                                       }
+                                               }
+                                       }
                                }
 
                                $scope.temp.policy.ruleGridData = [];
index 90d7cd1..c73fa60 100644 (file)
@@ -23,7 +23,7 @@ appDS2.factory('UserInfoServiceDS2', function ($http, $q,$log) {
                        var deferred = $q.defer();
                        $http({
                 method: "GET",
-                url: "get_PolicyUserInfo",    
+                url: "get_PolicyUserInfo"  
                        }).success(function(res) {    
                                if(res==null || res==''){
                                        $log.error('userInfoServiceDs2: failed to get top menu info');