rsercano/mongoclient

View on GitHub

Showing 698 of 698 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            for (i = 0; i < yaxes.length; ++i) {
                axis = yaxes[i];
                if (axis && axis.used) {
                    key = "y" + axis.n;
                    if (pos[key] == null && axis.n == 1)
Severity: Major
Found in client/plugins/flot/jquery.flot.js and 1 other location - About 5 hrs to fix
client/plugins/flot/jquery.flot.js on lines 949..961

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            for (i = 0; i < xaxes.length; ++i) {
                axis = xaxes[i];
                if (axis && axis.used) {
                    key = "x" + axis.n;
                    if (pos[key] == null && axis.n == 1)
Severity: Major
Found in client/plugins/flot/jquery.flot.js and 1 other location - About 5 hrs to fix
client/plugins/flot/jquery.flot.js on lines 963..975

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File util.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Communicator, ReactivityProvider } from '/client/imports/facades';
import { SessionManager, ErrorHandler, Notification, Enums, Querying } from '/client/imports/modules';
import { CollectionAdd, CollectionValidationRules, CollectionRename, CollectionFilter, CollectionConversion, Connection, ViewPipelineUpdater } from '/client/imports/ui';
import Helper from '/client/imports/helpers/helper';
import $ from 'jquery';
Severity: Minor
Found in client/imports/ui/collection/util.js - About 5 hrs to fix

    File render.js has 370 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Enums, ErrorHandler, Notification, SessionManager, UIComponents } from '/client/imports/modules';
    import { FlowRouter } from 'meteor/kadira:flow-router';
    import { Template } from 'meteor/templating';
    import { Communicator, ReactivityProvider } from '/client/imports/facades';
    import Helper from '/client/imports/helpers/helper';
    Severity: Minor
    Found in client/imports/ui/querying/render.js - About 4 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          Chosen.prototype.single_set_selected_text = function(text) {
            if (text == null) {
              text = this.default_text;
            }
            if (text === this.default_text) {
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.proto.js and 1 other location - About 4 hrs to fix
      client/plugins/chosen_fork/chosen.jquery.js on lines 1111..1122

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 125.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          Chosen.prototype.single_set_selected_text = function(text) {
            if (text == null) {
              text = this.default_text;
            }
            if (text === this.default_text) {
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 4 hrs to fix
      client/plugins/chosen_fork/chosen.proto.js on lines 1113..1124

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 125.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function tickGenerator has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          axis.tickGenerator = function(axis) {
      
                              var ticks = [];
                              var d = dateGenerator(axis.min, opts);
                              var minSize = 0;
      Severity: Major
      Found in client/plugins/flot/jquery.flot.time.js - About 4 hrs to fix

        Function Colorpicker has 111 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var Colorpicker = function(element, options) {
            this.element = $(element).addClass('colorpicker-element');
            this.options = $.extend(true, {}, defaults, this.element.data(), options);
            this.component = this.options.component;
            this.component = (this.component !== false) ? this.element.find(this.component) : false;
        Severity: Major
        Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js - About 4 hrs to fix

          Function parseOptions has 108 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function parseOptions(opts) {
          
                      $.extend(true, options, opts);
          
                      // $.extend merges arrays, rather than replacing them.  When less
          Severity: Major
          Found in client/plugins/flot/jquery.flot.js - About 4 hrs to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              this.spawnedShellsBySessionId[sessionId].stderr.on('data', Meteor.bindEnvironment((data) => {
                if (data && data.toString()) {
                  Database.create({
                    type: Database.types.ShellCommands,
                    document: {
            Severity: Major
            Found in server/imports/core/mongodb/shell.js and 1 other location - About 4 hrs to fix
            server/imports/core/mongodb/shell.js on lines 33..45

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 121.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              this.spawnedShellsBySessionId[sessionId].stdout.on('data', Meteor.bindEnvironment((data) => {
                if (data && data.toString()) {
                  Database.create({
                    type: Database.types.ShellCommands,
                    document: {
            Severity: Major
            Found in server/imports/core/mongodb/shell.js and 1 other location - About 4 hrs to fix
            server/imports/core/mongodb/shell.js on lines 47..59

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 121.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
            Severity: Major
            Found in client/plugins/chosen_fork/chosen.proto.js and 1 other location - About 4 hrs to fix
            client/plugins/chosen_fork/chosen.jquery.js on lines 16..16

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 119.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
            Severity: Major
            Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 4 hrs to fix
            client/plugins/chosen_fork/chosen.proto.js on lines 16..16

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 119.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            Template.aggregateHistories.onRendered(() => {
              if (!SessionManager.get(SessionManager.strSessionCollectionNames)) {
                FlowRouter.go('/databaseStats');
                return;
              }
            client/imports/views/pages/mc_shell/shell_histories/shell_histories.js on lines 6..18

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            Template.shellHistories.onRendered(() => {
              if (!SessionManager.get(SessionManager.strSessionCollectionNames)) {
                FlowRouter.go('/databaseStats');
                return;
              }
            client/imports/views/pages/aggregate_pipeline/aggregate_histories/aggregate_histories.js on lines 8..20

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  if (this.options.horizontal === false) {
                    sl = this.options.sliders;
                    icns.eq(1).css('top', sl.hue.maxTop * (1 - this.color.value.h)).end()
                      .eq(2).css('top', sl.alpha.maxTop * (1 - this.color.value.a));
                  } else {
            Severity: Major
            Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js and 1 other location - About 4 hrs to fix
            client/plugins/colorpicker/js/bootstrap-colorpicker.js on lines 1002..1006

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              populateInheritRolesToSave() {
                const result = [];
                const rolesToInherit = $('#tblRolesToInherit').DataTable().rows().data();
                for (let i = 0; i < rolesToInherit.length; i += 1) {
                  result.push({
            Severity: Major
            Found in client/imports/ui/user_management/roles.js and 1 other location - About 4 hrs to fix
            client/imports/ui/user_management/users.js on lines 189..200

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              populateUserRolesToSave() {
                const result = [];
                const roles = $('#tblUserRoles').DataTable().rows().data();
                for (let i = 0; i < roles.length; i += 1) {
                  result.push({
            Severity: Major
            Found in client/imports/ui/user_management/users.js and 1 other location - About 4 hrs to fix
            client/imports/ui/user_management/roles.js on lines 431..442

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  } else {
                    sl = this.options.slidersHorz;
                    icns.eq(1).css('left', sl.hue.maxLeft * (1 - this.color.value.h)).end()
                      .eq(2).css('left', sl.alpha.maxLeft * (1 - this.color.value.a));
                  }
            Severity: Major
            Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js and 1 other location - About 4 hrs to fix
            client/plugins/colorpicker/js/bootstrap-colorpicker.js on lines 998..1002

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            File index.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { FlowRouter } from 'meteor/kadira:flow-router';
            import { ReactivityProvider, Communicator } from '/client/imports/facades';
            import { UIComponents, SessionManager, Notification, ErrorHandler } from '/client/imports/modules';
            import $ from 'jquery';
            import ConnectionHelper from './helper';
            Severity: Minor
            Found in client/imports/ui/connection/index.js - About 4 hrs to fix
              Severity
              Category
              Status
              Source
              Language