Fixed code smell 'Unexpected empty arrow function' reported by SonarQube.

This commit is contained in:
Akshay Joshi 2022-01-12 18:59:21 +05:30
parent 4e414f57e6
commit 3f7e921cce
18 changed files with 41 additions and 41 deletions

View File

@ -269,7 +269,7 @@ function(
}); });
} }
}, },
function() {} function() {/*This is intentional (SonarQube)*/}
); );
}, },
detach_partition: function(args) { detach_partition: function(args) {
@ -312,7 +312,7 @@ function(
}); });
} }
}, },
function() {} function() {/*This is intentional (SonarQube)*/}
); );
}, },
}, },

View File

@ -213,7 +213,7 @@ define('pgadmin.node.table', [
Notify.pgRespErrorNotify(xhr, error); Notify.pgRespErrorNotify(xhr, error);
t.unload(i); t.unload(i);
}); });
}, function() {} }, function() {/*This is intentional (SonarQube)*/}
); );
}, },
reset_table_stats: function(args) { reset_table_stats: function(args) {
@ -255,7 +255,7 @@ define('pgadmin.node.table', [
t.unload(i); t.unload(i);
}); });
}, },
function() {} function() {/*This is intentional (SonarQube)*/}
); );
}, },
count_table_rows: function(args) { count_table_rows: function(args) {

View File

@ -969,7 +969,7 @@ define('pgadmin.node.server', [
}, },
}; };
}, },
build:function() {}, build:function() {/*This is intentional (SonarQube)*/},
prepare:function() { prepare:function() {
this.setContent(this.message); this.setContent(this.message);
}, },

View File

@ -393,7 +393,7 @@ define('pgadmin.browser', [
$el: $('<li><a class="dropdown-item disabled" href="#" role="menuitem">' + gettext('No object selected') + '</a></li>'), $el: $('<li><a class="dropdown-item disabled" href="#" role="menuitem">' + gettext('No object selected') + '</a></li>'),
priority: 1, priority: 1,
category: 'create', category: 'create',
update: function() {}, update: function() {/*This is intentional (SonarQube)*/},
}], false); }], false);
$obj_mnu.append(create_submenu.$el); $obj_mnu.append(create_submenu.$el);
} }
@ -518,8 +518,8 @@ define('pgadmin.browser', [
type:'POST', type:'POST',
headers: headers, headers: headers,
}) })
.done(function() {}) .done(function() {/*This is intentional (SonarQube)*/})
.fail(function() {}); .fail(function() {/*This is intentional (SonarQube)*/});
}, 300000); }, 300000);
obj.set_master_password(''); obj.set_master_password('');
@ -556,7 +556,7 @@ define('pgadmin.browser', [
'the original/corrupt file using a tool such as DB Browser for SQLite if desired.'+ 'the original/corrupt file using a tool such as DB Browser for SQLite if desired.'+
'<br><br>Original file: ' + res.data + '<br>Replacement file: ' + '<br><br>Original file: ' + res.data + '<br>Replacement file: ' +
res.data.substring(0, res.data.length - 14), res.data.substring(0, res.data.length - 14),
function() { function() { /*This is intentional (SonarQube)*/
} }
); );
} }

View File

@ -24,7 +24,7 @@ define([
if (pgBrowser.Collection) if (pgBrowser.Collection)
return pgBrowser.Collection; return pgBrowser.Collection;
pgBrowser.Collection = function() {}; pgBrowser.Collection = function() {/*This is intentional (SonarQube)*/};
_.extend( _.extend(
pgBrowser.Collection, pgBrowser.Collection,

View File

@ -40,7 +40,7 @@ define('pgadmin.browser.node', [
// A helper (base) class for all the nodes, this has basic // A helper (base) class for all the nodes, this has basic
// operations/callbacks defined for basic operation. // operations/callbacks defined for basic operation.
pgBrowser.Node = function() {}; pgBrowser.Node = function() {/*This is intentional (SonarQube)*/};
// Helper function to correctly set up the property chain, for subclasses. // Helper function to correctly set up the property chain, for subclasses.
// Uses a hash of class properties to be extended. // Uses a hash of class properties to be extended.

View File

@ -40,8 +40,8 @@ define([
beforeNext: function() { beforeNext: function() {
return true; return true;
}, },
onNext: function() {}, onNext: function() {/*This is intentional (SonarQube)*/},
onBefore: function() {}, onBefore: function() {/*This is intentional (SonarQube)*/},
/* Callback for before Previous */ /* Callback for before Previous */
beforePrev: function() { beforePrev: function() {
return true; return true;

View File

@ -1765,7 +1765,7 @@ define([
formData.append('mode', 'add'); formData.append('mode', 'add');
formData.append('currentpath', path); formData.append('currentpath', path);
$('.upload_file .dz_cross_btn').attr('disabled', 'disabled'); $('.upload_file .dz_cross_btn').attr('disabled', 'disabled');
setTimeout(function() {}, 10000); setTimeout(function() {/*This is intentional (SonarQube)*/}, 10000);
}, },
success: function(file, response) { success: function(file, response) {
var resp_data = response.data.result, var resp_data = response.data.result,
@ -1784,7 +1784,7 @@ define([
} }
getFolderInfo(path); getFolderInfo(path);
}, },
totaluploadprogress: function() {}, totaluploadprogress: function() {/*This is intentional (SonarQube)*/},
complete: function(file) { complete: function(file) {
if (file.status == 'error') { if (file.status == 'error') {
Notify.error(lg.upload_error); Notify.error(lg.upload_error);

View File

@ -27,7 +27,7 @@ define('misc.statistics', [
return pgBrowser.NodeStatistics; return pgBrowser.NodeStatistics;
} }
var SizeFormatter = Backgrid.SizeFormatter = function() {}; var SizeFormatter = Backgrid.SizeFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(SizeFormatter.prototype, { _.extend(SizeFormatter.prototype, {
/** /**
Takes a raw value from a model and returns the human readable formatted Takes a raw value from a model and returns the human readable formatted

View File

@ -100,7 +100,7 @@ define([
}; };
/* Returns raw data as it is */ /* Returns raw data as it is */
var RawFormatter = Backform.RawFormatter = function() {}; var RawFormatter = Backform.RawFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(RawFormatter.prototype, { _.extend(RawFormatter.prototype, {
fromRaw: function(rawData) { fromRaw: function(rawData) {
return rawData; return rawData;
@ -2204,7 +2204,7 @@ define([
return fields; return fields;
}; };
var Select2Formatter = function() {}; var Select2Formatter = function() {/*This is intentional (SonarQube)*/};
_.extend(Select2Formatter.prototype, { _.extend(Select2Formatter.prototype, {
fromRaw: function(rawData) { fromRaw: function(rawData) {
return encodeURIComponent(rawData); return encodeURIComponent(rawData);
@ -2492,7 +2492,7 @@ define([
} }
return this; return this;
}, },
formatter: function() {}, formatter: function() {/*This is intentional (SonarQube)*/},
cleanup: function() { cleanup: function() {
Backform.Fieldset.prototype.cleanup.apply(this); Backform.Fieldset.prototype.cleanup.apply(this);
}, },
@ -3352,7 +3352,7 @@ define([
}, },
}); });
var KeyCodeControlFormatter = Backform.KeyCodeControlFormatter = function() {}; var KeyCodeControlFormatter = Backform.KeyCodeControlFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(KeyCodeControlFormatter.prototype, { _.extend(KeyCodeControlFormatter.prototype, {
fromRaw: function (rawData) { fromRaw: function (rawData) {

View File

@ -1340,7 +1340,7 @@ define([
* displayed in the cell. * displayed in the cell.
*/ */
var InputStringArrayCellFormatter = Backgrid.Extension.InputStringArrayCellFormatter = var InputStringArrayCellFormatter = Backgrid.Extension.InputStringArrayCellFormatter =
function() {}; function() {/*This is intentional (SonarQube)*/};
_.extend(InputStringArrayCellFormatter.prototype, { _.extend(InputStringArrayCellFormatter.prototype, {
/** /**
* Takes a raw value from a model and returns an optionally formatted * Takes a raw value from a model and returns an optionally formatted
@ -1368,7 +1368,7 @@ define([
* displayed in the cell. * displayed in the cell.
*/ */
var InputIntegerArrayCellFormatter = Backgrid.Extension.InputIntegerArrayCellFormatter = var InputIntegerArrayCellFormatter = Backgrid.Extension.InputIntegerArrayCellFormatter =
function() {}; function() {/*This is intentional (SonarQube)*/};
_.extend(InputIntegerArrayCellFormatter.prototype, { _.extend(InputIntegerArrayCellFormatter.prototype, {
/** /**
* Takes a raw value from a model and returns an optionally formatted * Takes a raw value from a model and returns an optionally formatted
@ -1402,7 +1402,7 @@ define([
* displayed in the cell. * displayed in the cell.
*/ */
var InputNumberArrayCellFormatter= Backgrid.Extension.InputNumberArrayCellFormatter = var InputNumberArrayCellFormatter= Backgrid.Extension.InputNumberArrayCellFormatter =
function() {}; function() {/*This is intentional (SonarQube)*/};
_.extend(InputNumberArrayCellFormatter.prototype, { _.extend(InputNumberArrayCellFormatter.prototype, {
/** /**
* Takes a raw value from a model and returns an optionally formatted * Takes a raw value from a model and returns an optionally formatted
@ -1542,7 +1542,7 @@ define([
* *
* @class Backgrid.Extension.DependentCell * @class Backgrid.Extension.DependentCell
**/ **/
var DependentCell = Backgrid.Extension.DependentCell = function() {}; var DependentCell = Backgrid.Extension.DependentCell = function() {/*This is intentional (SonarQube)*/};
_.extend( _.extend(
DependentCell.prototype, { DependentCell.prototype, {
@ -1582,7 +1582,7 @@ define([
@extends Backgrid.CellFormatter @extends Backgrid.CellFormatter
@constructor @constructor
*/ */
var PasswordFormatter = Backgrid.PasswordFormatter = function() {}; var PasswordFormatter = Backgrid.PasswordFormatter = function() {/*This is intentional (SonarQube)*/};
PasswordFormatter.prototype = new Backgrid.CellFormatter(); PasswordFormatter.prototype = new Backgrid.CellFormatter();
_.extend(PasswordFormatter.prototype, { _.extend(PasswordFormatter.prototype, {
fromRaw: function(rawValue) { fromRaw: function(rawValue) {
@ -1639,7 +1639,7 @@ define([
* JSONBCell Formatter. * JSONBCell Formatter.
*/ */
var JSONBCellFormatter = Backgrid.Extension.JSONBCellFormatter = var JSONBCellFormatter = Backgrid.Extension.JSONBCellFormatter =
function() {}; function() {/*This is intentional (SonarQube)*/};
_.extend(JSONBCellFormatter.prototype, { _.extend(JSONBCellFormatter.prototype, {
fromRaw: function(rawData) { fromRaw: function(rawData) {
// json data // json data
@ -2104,7 +2104,7 @@ define([
}, },
}); });
var BooleanCellFormatter = Backgrid.BooleanCellFormatter = function() {}; var BooleanCellFormatter = Backgrid.BooleanCellFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(BooleanCellFormatter.prototype, { _.extend(BooleanCellFormatter.prototype, {
fromRaw: function (rawValue) { fromRaw: function (rawValue) {
if (_.isUndefined(rawValue) || _.isNull(rawValue)) { if (_.isUndefined(rawValue) || _.isNull(rawValue)) {

View File

@ -131,7 +131,7 @@
@class Backform.ControlFormatter @class Backform.ControlFormatter
@constructor @constructor
*/ */
var ControlFormatter = Backform.ControlFormatter = function() {}; var ControlFormatter = Backform.ControlFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(ControlFormatter.prototype, { _.extend(ControlFormatter.prototype, {
/** /**
@ -167,7 +167,7 @@
}); });
// Store value in DOM as stringified JSON. // Store value in DOM as stringified JSON.
var JSONFormatter = Backform.JSONFormatter = function() {}; var JSONFormatter = Backform.JSONFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(JSONFormatter.prototype, { _.extend(JSONFormatter.prototype, {
fromRaw: function(rawData, model) { fromRaw: function(rawData, model) {
return JSON.stringify(rawData); return JSON.stringify(rawData);

View File

@ -1975,7 +1975,7 @@ var requirejs, require, define;
// Post a task to the event loop to work around a bug in WebKit // Post a task to the event loop to work around a bug in WebKit
// where the worker gets garbage-collected after calling // where the worker gets garbage-collected after calling
// importScripts(): https://webkit.org/b/153317 // importScripts(): https://webkit.org/b/153317
setTimeout(function() {}, 0); setTimeout(function() {/*This is intentional (SonarQube)*/}, 0);
importScripts(url); importScripts(url);
//Account for anonymous modules //Account for anonymous modules

View File

@ -856,7 +856,7 @@ define([
'data': JSON.stringify(sqlite_func_args_list), 'data': JSON.stringify(sqlite_func_args_list),
}, },
}) })
.done(function() {}) .done(function() {/*This is intentional (SonarQube)*/})
.fail(function() { .fail(function() {
Notify.alert( Notify.alert(
gettext('Debugger Error'), gettext('Debugger Error'),
@ -884,7 +884,7 @@ define([
'data': JSON.stringify(args_value_list), 'data': JSON.stringify(args_value_list),
}, },
}) })
.done(function() {}) .done(function() {/*This is intentional (SonarQube)*/})
.fail(function(er) { .fail(function(er) {
Notify.alert( Notify.alert(
gettext('Debugger Listener Startup Error'), gettext('Debugger Listener Startup Error'),
@ -906,7 +906,7 @@ define([
'data': JSON.stringify(sqlite_func_args_list), 'data': JSON.stringify(sqlite_func_args_list),
}, },
}) })
.done(function() {}) .done(function() {/*This is intentional (SonarQube)*/})
.fail(function() { .fail(function() {
Notify.alert( Notify.alert(
gettext('Debugger Error'), gettext('Debugger Error'),

View File

@ -33,7 +33,7 @@ define([
if (pgTools.DirectDebug) if (pgTools.DirectDebug)
return pgTools.DirectDebug; return pgTools.DirectDebug;
var controller = new(function() {}); var controller = new(function() {/*This is intentional (SonarQube)*/});
_.extend( _.extend(
controller, Backbone.Events, { controller, Backbone.Events, {
@ -1491,7 +1491,7 @@ define([
Function is responsible to create the new wcDocker instance for debugger and Function is responsible to create the new wcDocker instance for debugger and
initialize the debugger panel inside the docker instance. initialize the debugger panel inside the docker instance.
*/ */
var DirectDebug = function() {}; var DirectDebug = function() {/*This is intentional (SonarQube)*/};
_.extend(DirectDebug.prototype, { _.extend(DirectDebug.prototype, {
/* We should get the transaction id from the server during initialization here */ /* We should get the transaction id from the server during initialization here */

View File

@ -939,7 +939,7 @@ export default class SchemaDiffUI {
}, },
}; };
}, },
build:function() {}, build:function() {/*This is intentional (SonarQube)*/},
prepare:function() { prepare:function() {
this.setContent(this.message); this.setContent(this.message);
}, },

View File

@ -256,8 +256,8 @@ describe('ERDCore', ()=>{
spyOn(erdCoreObj, 'getNewLink').and.callFake(function() { spyOn(erdCoreObj, 'getNewLink').and.callFake(function() {
return { return {
setSourcePort: function() {}, setSourcePort: function() {/*This is intentional (SonarQube)*/},
setTargetPort: function() {}, setTargetPort: function() {/*This is intentional (SonarQube)*/},
}; };
}); });
spyOn(erdCoreObj, 'getNewPort').and.returnValue({id: 'id'}); spyOn(erdCoreObj, 'getNewPort').and.returnValue({id: 'id'});

View File

@ -124,7 +124,7 @@ describe('fileSelectDialog', function () {
}; };
spyOn(Alertify, 'fileSelectionDlg').and.callFake(function() { spyOn(Alertify, 'fileSelectionDlg').and.callFake(function() {
this.resizeTo = function() {}; this.resizeTo = function() {/*This is intentional (SonarQube)*/};
return this; return this;
}); });
@ -140,7 +140,7 @@ describe('fileSelectDialog', function () {
}; };
spyOn(Alertify, 'createModeDlg').and.callFake(function() { spyOn(Alertify, 'createModeDlg').and.callFake(function() {
this.resizeTo = function() {}; this.resizeTo = function() {/*This is intentional (SonarQube)*/};
return this; return this;
}); });
@ -208,7 +208,7 @@ describe('fileSelectDialog', function () {
}; };
spyOn(Alertify, 'fileStorageDlg').and.callFake(function() { spyOn(Alertify, 'fileStorageDlg').and.callFake(function() {
this.resizeTo = function() {}; this.resizeTo = function() {/*This is intentional (SonarQube)*/};
return this; return this;
}); });