mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed following code smells reported by SonarQube:
1) Immediately return this expression instead of assigning it to the temporary variable. 2) Extract this nested ternary operation into an independent statement. 3) Expected a `for-of` loop instead of a `for` loop with this simple iteration.
This commit is contained in:
@@ -52,10 +52,10 @@ define('tools.restore', [
|
||||
},
|
||||
}];
|
||||
|
||||
for (var idx = 0; idx < menuUtils.restoreSupportedNodes.length; idx++) {
|
||||
for (let sup_node_val of menuUtils.restoreSupportedNodes) {
|
||||
menus.push({
|
||||
name: 'restore_' + menuUtils.restoreSupportedNodes[idx],
|
||||
node: menuUtils.restoreSupportedNodes[idx],
|
||||
name: 'restore_' + sup_node_val,
|
||||
node: sup_node_val,
|
||||
module: this,
|
||||
applies: ['context'],
|
||||
callback: 'restoreObjects',
|
||||
@@ -173,7 +173,6 @@ define('tools.restore', [
|
||||
gettext('Utility not found'),
|
||||
gettext('Failed to fetch Utility information')
|
||||
);
|
||||
return;
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user