mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-04 12:36:44 -05: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:
1 parent
e3807ec3d6
commit
9f836f5433
62 files changed
+367
-319
No files matched your search
@@ -413,12 +413,14 @@ define('misc.statistics', [
|
||||
this.columns = this.statistic_columns;
|
||||
for (var idx in columns) {
|
||||
name = (columns[idx])['name'];
|
||||
let val = null;
|
||||
if (row && row[name]) {
|
||||
val = _.indexOf(prettifyFields, name) != -1 ? sizePrettify(row[name]) : row[name];
|
||||
}
|
||||
res.push({
|
||||
'statistics': name,
|
||||
// Check if row is undefined?
|
||||
'value': row && row[name] ?
|
||||
((_.indexOf(prettifyFields, name) != -1) ?
|
||||
sizePrettify(row[name]) : row[name]) : null,
|
||||
'value': val,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user