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) {
@ -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);
t.unload(i);
});
}, function() {}
}, function() {/*This is intentional (SonarQube)*/}
);
},
reset_table_stats: function(args) {
@ -255,7 +255,7 @@ define('pgadmin.node.table', [
t.unload(i);
});
},
function() {}
function() {/*This is intentional (SonarQube)*/}
);
},
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() {
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>'),
priority: 1,
category: 'create',
update: function() {},
update: function() {/*This is intentional (SonarQube)*/},
}], false);
$obj_mnu.append(create_submenu.$el);
}
@ -518,8 +518,8 @@ define('pgadmin.browser', [
type:'POST',
headers: headers,
})
.done(function() {})
.fail(function() {});
.done(function() {/*This is intentional (SonarQube)*/})
.fail(function() {/*This is intentional (SonarQube)*/});
}, 300000);
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.'+
'<br><br>Original file: ' + res.data + '<br>Replacement file: ' +
res.data.substring(0, res.data.length - 14),
function() {
function() { /*This is intentional (SonarQube)*/
}
);
}

View File

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

View File

@ -40,7 +40,7 @@ define('pgadmin.browser.node', [
// A helper (base) class for all the nodes, this has basic
// 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.
// Uses a hash of class properties to be extended.

View File

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

View File

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

View File

@ -27,7 +27,7 @@ define('misc.statistics', [
return pgBrowser.NodeStatistics;
}
var SizeFormatter = Backgrid.SizeFormatter = function() {};
var SizeFormatter = Backgrid.SizeFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(SizeFormatter.prototype, {
/**
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 */
var RawFormatter = Backform.RawFormatter = function() {};
var RawFormatter = Backform.RawFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(RawFormatter.prototype, {
fromRaw: function(rawData) {
return rawData;
@ -2204,7 +2204,7 @@ define([
return fields;
};
var Select2Formatter = function() {};
var Select2Formatter = function() {/*This is intentional (SonarQube)*/};
_.extend(Select2Formatter.prototype, {
fromRaw: function(rawData) {
return encodeURIComponent(rawData);
@ -2492,7 +2492,7 @@ define([
}
return this;
},
formatter: function() {},
formatter: function() {/*This is intentional (SonarQube)*/},
cleanup: function() {
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, {
fromRaw: function (rawData) {

View File

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

View File

@ -131,7 +131,7 @@
@class Backform.ControlFormatter
@constructor
*/
var ControlFormatter = Backform.ControlFormatter = function() {};
var ControlFormatter = Backform.ControlFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(ControlFormatter.prototype, {
/**
@ -167,7 +167,7 @@
});
// Store value in DOM as stringified JSON.
var JSONFormatter = Backform.JSONFormatter = function() {};
var JSONFormatter = Backform.JSONFormatter = function() {/*This is intentional (SonarQube)*/};
_.extend(JSONFormatter.prototype, {
fromRaw: function(rawData, model) {
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
// where the worker gets garbage-collected after calling
// importScripts(): https://webkit.org/b/153317
setTimeout(function() {}, 0);
setTimeout(function() {/*This is intentional (SonarQube)*/}, 0);
importScripts(url);
//Account for anonymous modules

View File

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

View File

@ -33,7 +33,7 @@ define([
if (pgTools.DirectDebug)
return pgTools.DirectDebug;
var controller = new(function() {});
var controller = new(function() {/*This is intentional (SonarQube)*/});
_.extend(
controller, Backbone.Events, {
@ -1491,7 +1491,7 @@ define([
Function is responsible to create the new wcDocker instance for debugger and
initialize the debugger panel inside the docker instance.
*/
var DirectDebug = function() {};
var DirectDebug = function() {/*This is intentional (SonarQube)*/};
_.extend(DirectDebug.prototype, {
/* 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() {
this.setContent(this.message);
},

View File

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

View File

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