Fixed SonarQube issues.

This commit is contained in:
Akshay Joshi
2022-09-08 18:08:58 +05:30
parent 603ce21d24
commit 7086719640
129 changed files with 945 additions and 981 deletions

View File

@@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////
define([], function() {
var pgAdmin = window.pgAdmin = window.pgAdmin || {};
let pgAdmin = window.pgAdmin = window.pgAdmin || {};
// Reference:
// https://github.com/heygrady/Units/blob/master/Length.min.js
@@ -57,7 +57,7 @@ define([], function() {
else('auto' === _o || _i && 'px' !== _i) && m ? _o = 0 : _i && 'px' !== _i && !m && (_o = r(_t, _o) + 'px');
return _o;
}
var p, n = e.createElement('test'),
let p, n = e.createElement('test'),
i = e.documentElement,
l = e.defaultView,
m = l && l.getComputedStyle,
@@ -76,7 +76,7 @@ define([], function() {
pgAdmin.natural_sort = function(a, b, options) {
options = options || {};
var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
let re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
sre = /(^[ ]*|[ ]*$)/g,
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
hre = /^0x[0-9a-f]+$/i,
@@ -102,7 +102,7 @@ define([], function() {
else if (xD > yD) return 1 * mult;
// natural sorting through split numeric strings and default strings
for (var cLoc = 0, numS = Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
for (let cLoc = 0, numS = Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;