Showing 331 of 698 total issues
Function DBStats
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DBStats = function () {
this.interval = null;
this.memoryChart = null;
this.connectionsChart = null;
this.networkChart = null;
prototype
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
UserManagementRoles.prototype = {
addInheritRole() {
const db = $('#cmbDatabasesForInheritRole').val();
const role = $('#cmbRolesForDBForInheritedRole').val();
Function zoom
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
plot.zoom = function (args) {
if (!args)
args = {};
var c = args.center,
Function toString
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
toString: function(format, translateAlias) {
format = format || this.origFormat || this.fallbackFormat;
translateAlias = translateAlias || false;
var c = false;
Function initOptions
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
initOptions(optionEnum, showRunOnAdmin, ...excludedOptions) {
switch (optionEnum) {
case Enums.ADD_USER_OPTIONS:
initOptions.call(this, $('#cmbAddUserOptions'), Enums.ADD_USER_OPTIONS, showRunOnAdmin, ...excludedOptions);
break;
Function redirect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
redirect() {
let query;
if (this.selectedOption === '1') query = `{ ${this.fieldName}:{ $exists: true }}`;
else if (this.selectedOption === '2') {
this.regexOptions = this.regexOptions ? this.regexOptions.join('') : '';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function findNearbySlice
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findNearbySlice(mouseX, mouseY) {
var slices = plot.getData(),
options = plot.getOptions(),
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
Function fillInSeriesOptions
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fillInSeriesOptions() {
var neededColors = series.length, maxIndex = -1, i;
// Subtract the number of series that already have fixed colors or
Function getConnectionUrl
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
getConnectionUrl(connection, username, password, addAuthSource, keepDB) {
if (connection.url) {
if (username || password) ConnectionHelper.changeUsernameAndPasswordFromConnectionUrl(connection, username, password);
if (!keepDB) ConnectionHelper.extractDBFromConnectionUrl(connection);
else ConnectionHelper.putCorrectDBToConnectionUrl(connection);
Function initFilesInformation
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
initFilesInformation() {
Notification.start('#btnReloadFiles');
let selector = UIComponents.Editor.getCodeMirrorValue($('#divSelector'));
selector = ExtendedJSON.convertAndCheckJSON(selector);
Function drawLabels
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawLabels() {
var currentAngle = startAngle;
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
Function mousemove
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
mousemove: function(e) {
if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
e.pageX = e.originalEvent.touches[0].pageX;
e.pageY = e.originalEvent.touches[0].pageY;
}
Function initUserTree
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
initUserTree() {
this.defaultInformationText = Helper.translate({ key: 'user_management_default_tree_text' });
SessionManager.set(SessionManager.strSessionUsermanagementInfo, '');
SessionManager.set(SessionManager.strSessionSelectionUserManagement, this.defaultInformationText);
$('#btnEditUser').hide();
Function gatherOptions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
gatherOptions() {
const options = this.getOptions();
if (options.ERROR) {
Notification.error(options.ERROR);
return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getFindModifyFinalObject
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const getFindModifyFinalObject = function (queryStr) {
return {
execute(historyParams) {
const options = historyParams ? historyParams.options : QueryingOptions.getOptions(Enums.FINDONE_MODIFY_OPTIONS);
const selector = getFromHistoryOrEditor(historyParams, $('#divSelector'));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function populateConnectionsTable
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
populateConnectionsTable() {
UIComponents.DataTable.setupDatatable({
selectorString: '#tblConnection',
extraOptions: {
createdRow(row, data) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function executeBinary
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const executeBinary = function (args, sessionId, binaryName) {
const binaryPath = MongoDBHelper.getProperBinary(binaryName);
const metadataToLog = { args, sessionId, binaryPath };
Logger.info({ message: `${binaryName}`, metadataToLog });
Function setupGrid
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupGrid() {
var i, axes = allAxes(), showGrid = options.grid.show;
// Initialize the plot's offset from the edge of the canvas
Function Error
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Error = function Error() {
this.types = {
ParseUrlError: {
Exception: Meteor.Error.bind(this, 1000),
message: 'parse-url-error'
Function saveFindEditor
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveFindEditor() {
const activeTab = $('#resultTabs').find('li.active').find('a').attr('href');
const findData = $(activeTab).data('findData');
if (!findData) {
Notification.error('no-result-found-to-save');