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:
@@ -51,10 +51,13 @@ define('misc.dependents', [
|
||||
parse: function(res) {
|
||||
var node = pgBrowser.Nodes[res.type];
|
||||
if(res.icon == null || res.icon == '') {
|
||||
res.icon = node ? (_.isFunction(node['node_image']) ?
|
||||
(node['node_image']).apply(node, [null, null]) :
|
||||
(node['node_image'] || ('icon-' + res.type))) :
|
||||
('icon-' + res.type);
|
||||
if (node) {
|
||||
res.icon = _.isFunction(node['node_image']) ?
|
||||
(node['node_image']).apply(node, [null, null]) :
|
||||
(node['node_image'] || ('icon-' + res.type));
|
||||
} else {
|
||||
res.icon = ('icon-' + res.type);
|
||||
}
|
||||
}
|
||||
res.type = pgadminUtils.titleize(res.type.replace(/_/g, ' '), true);
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user