Showing 331 of 698 total issues
Function Communicator
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Communicator = function () {
this.methods = {
count: { selectedCollection: '', selector: {}, options: {} },
find: { selectedCollection: '', selector: {}, cursorOptions: {}, executeExplain: false },
dropAllCollections: { },
Function findNearbyItem
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findNearbyItem(mouseX, mouseY, seriesFilter) {
var maxDistance = options.grid.mouseActiveRadius,
smallestDistance = maxDistance * maxDistance + 1,
item = null, foundPoint = false, i, j, ps;
Function respond
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
respond() {
const txt = $('#inputQueryWizardResponse');
const txtDiv = $('#divQueryWizardTxt');
const cmbDiv = $('#divQueryWizardCombo');
const cmb = $('#cmbQueryWizardResponses');
Function getErrorMessage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
getErrorMessage(err, result, translateOptions) {
let errorMessage = Helper.translate({ key: 'unknown-error' });
if (err) {
if (err.details && err.details.message) {
// external error comes with directly throwing (err.error = code)
- 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 populateFieldsTable
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
populateFieldsTable(data) {
this.ensureFieldsDataForDatatable(data);
UIComponents.DataTable.setupDatatable({
selectorString: '#tblFieldsDetails',
data,
prototype
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
QueryRender.prototype = {
executeQuery() {
const queryTemplate = SessionManager.get(SessionManager.strSessionSelectedQuery);
// Since user can call here by CTRL-ENTER combination, it's a must to check URL.
if (FlowRouter.current().route.path === '/browseCollection' || FlowRouter.current().route.path === '/adminQueries') {
prototype
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
ConnectionHelper.prototype = {
isCredentialPromptNeeded(connection) {
return connection.authenticationType && connection.authenticationType !== 'mongodb_x509'
&& (!connection[connection.authenticationType].username || !connection[connection.authenticationType].password);
},
Function ensureFieldsDataForDatatable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
ensureFieldsDataForDatatable(data) {
for (let i = 0; i < data.length; i += 1) {
if (!data[i].value.types.String) data[i].value.types.String = '';
if (!data[i].value.types.Number) data[i].value.types.Number = '';
if (!data[i].value.types.Array) data[i].value.types.Array = '';
- 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 plotLine
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
prevx = null, prevy = null;
File users.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Communicator, ReactivityProvider } from '/client/imports/facades';
import { Notification, ErrorHandler, SessionManager, UIComponents, ExtendedJSON } from '/client/imports/modules';
import Helper from '/client/imports/helpers/helper';
import UsermanagementHelper from './helper';
import $ from 'jquery';
Function allocateAxisBoxFirstPhase
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function allocateAxisBoxFirstPhase(axis) {
// find the bounding box of the axis by looking at label
// widths/heights and ticks, make room by diminishing the
// plotOffset; this first phase only looks at one
// dimension per axis, the other dimension depends on the
Function winnow_results
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
AbstractChosen.prototype.winnow_results = function() {
var eregex, escapedSearchText, exact_result, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
this.no_results_clear();
results = 0;
exact_result = false;
Function winnow_results
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
AbstractChosen.prototype.winnow_results = function() {
var eregex, escapedSearchText, exact_result, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
this.no_results_clear();
results = 0;
exact_result = false;
Function gatherCommandAutoCompletions
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
gatherCommandAutoCompletions(editorValue, curWord) {
if (curWord) return this.lastRegex;
let matched = editorValue.match(/[^\s"']+|"([^"]*)"|'([^']*)'/gm);
matched = matched ? matched.join('') : '';
editorValue = !editorValue ? editorValue : matched;
Function fetchStatus
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
fetchStatus() {
if (SessionManager.get(SessionManager.strSessionCollectionNames)) {
const settings = ReactivityProvider.findOne(ReactivityProvider.types.Settings);
if (settings) {
Communicator.call({
- 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 formatDate
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatDate(d, fmt, monthNames, dayNames) {
if (typeof d.strftime == "function") {
return d.strftime(fmt);
}
Function combine
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function combine(data) {
var total = 0,
combined = 0,
numCombined = 0,
File add.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { SessionManager, UIComponents, Enums, ExtendedJSON, ErrorHandler, Notification } from '/client/imports/modules';
import { Communicator, ReactivityProvider } from '/client/imports/facades';
import { Connection } from '/client/imports/ui';
import $ from 'jquery';
Function setEventsToShell
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setEventsToShell = function (connectionId, sessionId) {
Logger.info({ message: 'shell-event-bind', metadataToLog: { connectionId, sessionId } });
this.spawnedShellsBySessionId[sessionId].on('error', Meteor.bindEnvironment((error) => {
Logger.error({ message: 'shell-event-bind', metadataToLog: { error, sessionId } });
Function populateConnectionsTable
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
populateConnectionsTable() {
UIComponents.DataTable.setupDatatable({
selectorString: '#tblConnection',
extraOptions: {
createdRow(row, data) {