rsercano/mongoclient

View on GitHub

Showing 331 of 698 total issues

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

import { ExtendedJSON, SessionManager } from '/client/imports/modules';
import { ReactivityProvider } from '/client/imports/facades';
import $ from 'jquery';
import Helper from '/client/imports/helpers/helper';
import { QueryRender } from '/client/imports/ui/querying';
Severity: Minor
Found in client/imports/modules/ui_components/index.js - About 5 hrs to fix

    Function prepareContextMenuItems has 127 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      prepareContextMenuItems({ addCollectionModal, convertToCappedModal, renameModal, validationRulesModal, filterModal, updateViewPipeline }) {
        const self = this;
        return {
          manage_collection: {
            name: Helper.translate({ key: 'manage' }),
    Severity: Major
    Found in client/imports/ui/collection/util.js - About 5 hrs to fix

      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

          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

                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

                  Function drawPie has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function drawPie() {
                  
                                  var startAngle = Math.PI * options.series.pie.startAngle;
                                  var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
                  
                  
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js - About 4 hrs to fix

                    Function initRules has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                      initRules() {
                        const selectedCollection = $('#validationRulesModal').data('collection');
                        if (!selectedCollection) return;
                    
                        const connection = ReactivityProvider.findOne(ReactivityProvider.types.Connections, { _id: SessionManager.get(SessionManager.strSessionConnection)._id });
                    Severity: Minor
                    Found in client/imports/ui/collection/validation_rules.js - About 3 hrs to fix

                    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 plotLineArea has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                function plotLineArea(datapoints, axisx, axisy) {
                                    var points = datapoints.points,
                                        ps = datapoints.pointsize,
                                        bottom = Math.min(Math.max(0, axisy.min), axisy.max),
                                        i = 0, top, areaOpen = false,
                    Severity: Major
                    Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

                      Function setupTickGeneration has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function setupTickGeneration(axis) {
                                  var opts = axis.options;
                      
                                  // estimate number of ticks
                                  var noTicks;
                      Severity: Major
                      Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

                        Function insertLegend has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function insertLegend() {
                        
                                    if (options.legend.container != null) {
                                        $(options.legend.container).html("");
                                    } else {
                        Severity: Major
                        Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

                          File jquery.flot.time.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* Pretty handling of time axes.
                          
                          Copyright (c) 2007-2014 IOLA and Ole Laursen.
                          Licensed under the MIT license.
                          
                          
                          Severity: Minor
                          Found in client/plugins/flot/jquery.flot.time.js - About 3 hrs to fix

                            Function register_observers has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Chosen.prototype.register_observers = function() {
                                  var _this = this;
                                  this.container.observe("touchstart", function(evt) {
                                    _this.container_mousedown(evt);
                                    return evt.preventDefault();
                            Severity: Major
                            Found in client/plugins/chosen_fork/chosen.proto.js - About 3 hrs to fix

                              `` has 28 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              Meteor.methods({
                                profilingInfo({ sessionId }) {
                                  const methodArray = [
                                    {
                                      profilingInfo: [],
                              Severity: Minor
                              Found in server/imports/methods/mongodb/collection.js - About 3 hrs to fix

                                File helper.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { ReactivityProvider } from '/client/imports/facades';
                                import { SessionManager, UIComponents } from '/client/imports/modules';
                                import $ from 'jquery';
                                import Helper from '../../helpers/helper';
                                import { ReactiveVar } from 'meteor/reactive-var';
                                Severity: Minor
                                Found in client/imports/ui/connection/helper.js - About 3 hrs to fix

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

                                  import { Database, Logger, Error } from '/server/imports/modules';
                                  import ConnectionHelper from './helper';
                                  
                                  const fs = require('fs');
                                  const mongodbUrlParser = require('mongodb-url');
                                  Severity: Minor
                                  Found in server/imports/core/connection/index.js - About 3 hrs to fix

                                    Function register_observers has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        Chosen.prototype.register_observers = function() {
                                          var _this = this;
                                          this.container.bind('touchstart.chosen', function(evt) {
                                            _this.container_mousedown(evt);
                                            return evt.preventDefault();
                                    Severity: Major
                                    Found in client/plugins/chosen_fork/chosen.jquery.js - About 3 hrs to fix

                                      Function drawBar has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
                                                  var left, right, bottom, top,
                                                      drawLeft, drawRight, drawTop, drawBottom,
                                                      tmp;
                                      
                                      
                                      Severity: Major
                                      Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language