Showing 331 of 698 total issues
Function populateTableData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
populateTableData(indexInfo, stats, indexStats) {
const result = [];
indexInfo.result.forEach((obj) => {
const index = {
name: obj.name,
Function drawSeriesPoints
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSeriesPoints(series) {
function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
var points = datapoints.points, ps = datapoints.pointsize;
for (var i = 0; i < points.length; i += ps) {
Function gatherOptions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
gatherOptions() {
const options = this.getOptions();
if (options.ERROR) {
Notification.error(options.ERROR);
return;
Function migrateConnectionsIfExist
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
migrateConnectionsIfExist() {
Logger.info({ message: 'migrate-connections' });
const settings = Database.readOne({ type: Database.types.Settings, query: {} });
if (settings.isMigrationDone) return;
Function addStageElement
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
addStageElement(query, val) {
const cmb = $('#cmbStageQueries');
query = query || cmb.val();
if (query) {
query = (query.indexOf('$') !== -1 ? query : `$${query}`);
Function initUsers
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
initUsers() {
Notification.start('#btnCloseUMDB');
const command = {
usersInfo: 1,
Function saveFindEditor
has a Cognitive Complexity of 14 (exceeds 5 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');
- 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 respond
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
respond() {
const txt = $('#inputQueryWizardResponse');
const txtDiv = $('#divQueryWizardTxt');
const cmbDiv = $('#divQueryWizardCombo');
const cmb = $('#cmbQueryWizardResponses');
- 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 result_select
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.result_select = function(evt) {
var high, item;
if (this.result_highlight) {
high = this.result_highlight;
if (high.hasClass("create-option")) {
Function analyzeSchema
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
analyzeSchema({ connectionId, username, password, collection, sessionId }) {
const connection = Database.readOne({ type: Database.types.Connections, query: { _id: connectionId } });
const connectionUrl = Connection.getConnectionUrl(connection, username, password, true, true);
const args = [connectionUrl, '--quiet', '--eval', `var collection =\"${collection}\", outputFormat=\"json\"`, `${MongoDBHelper.getMongoExternalsPath()}/variety/variety.js_`];
const metadataToLog = { sessionId, args, collection };
Consider simplifying this complex logical expression. Open
if (opts.mode == "time") {
axis.tickGenerator = function(axis) {
var ticks = [];
var d = dateGenerator(axis.min, opts);
Consider simplifying this complex logical expression. Open
if (isNaN(v) || v < axis.min || v > axis.max
// skip those lying on the axes if we got a border
|| (t == "full"
&& ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0)
&& (v == axis.min || v == axis.max)))
Function getTextInfo
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {
var textStyle, layerCache, styleCache, info;
// Cast the value to a string, in case we were given a number or such
Function tickFormatter
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
axis.tickFormatter = function (v, axis) {
var d = dateGenerator(v, axis.options);
// first check global format
Function extractIndexOptions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
extractIndexOptions() {
let partialFilterExpression = UIComponents.Editor.getCodeMirrorValue($('#divPartial'));
if (partialFilterExpression) {
partialFilterExpression = ExtendedJSON.convertAndCheckJSON(partialFilterExpression);
if (partialFilterExpression.ERROR) {
Function saveUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveUser() {
const usernameSelector = $('#inputUsernameUM');
const passwordSelector = $('#inputPasswordUM');
const titleSelector = $('#addEditUserModalTitle');
Function fetchStatus
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchStatus() {
if (SessionManager.get(SessionManager.strSessionCollectionNames)) {
const settings = ReactivityProvider.findOne(ReactivityProvider.types.Settings);
if (settings) {
Communicator.call({
Function result_select
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.result_select = function(evt) {
var high, item;
if (this.result_highlight) {
high = this.result_highlight;
if (high.hasClassName("create-option")) {
Function set_up_html
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.set_up_html = function() {
var container_classes, container_props;
container_classes = ["chosen-container"];
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
if (this.inherit_select_classes && this.form_field.className) {
Function checkSSHOfConnection
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const checkSSHOfConnection = function (connection) {
if (connection.ssh) {
if (!connection.ssh.enabled) delete connection.ssh;
if (!connection.ssh.destinationPort) Error.create({ type: Error.types.MissingParameter, formatters: ['destination-port', 'ssh'], metadataToLog: connection });
if (!connection.ssh.username) Error.create({ type: Error.types.MissingParameter, formatters: ['username', 'ssh'], metadataToLog: connection });
- 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"