rsercano/mongoclient

View on GitHub

Showing 698 of 698 total issues

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

    BulkWrite: {
      execute(historyParams) {
        const operations = getFromHistoryOrEditor(historyParams, $('#divBulkWrite'), 'bulkWrite');
        const options = historyParams ? historyParams.options : QueryingOptions.getOptions(Enums.BULK_WRITE_OPTIONS);

Severity: Major
Found in client/imports/ui/querying/querying.js and 1 other location - About 7 hrs to fix
client/imports/ui/querying/querying.js on lines 685..708

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 187.

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

        function drawSeriesLines(series) {
            function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                var points = datapoints.points,
                    ps = datapoints.pointsize,
                    prevx = null, prevy = null;
Severity: Major
Found in client/plugins/flot/jquery.flot.js - About 7 hrs to fix

    Function drawGrid has 186 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function drawGrid() {
                var i, axes, bw, bc;
    
                ctx.save();
                ctx.translate(plotOffset.left, plotOffset.top);
    Severity: Major
    Found in client/plugins/flot/jquery.flot.js - About 7 hrs to fix

      Function draw has 175 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function draw(plot, newCtx) {
      
                  if (!target) {
                      return; // if no series were passed
                  }
      Severity: Major
      Found in client/plugins/flot/jquery.flot.pie.js - About 7 hrs to fix

        Function init has 171 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function init(plot) {
                function onZoomClick(e, zoomOut) {
                    var c = plot.offset();
                    c.left = e.pageX - c.left;
                    c.top = e.pageY - c.top;
        Severity: Major
        Found in client/plugins/flot/jquery.flot.navigate.js - About 6 hrs to fix

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

                              if (x1 <= x2 && x1 < axisx.min) {
                                  if (x2 < axisx.min)
                                      continue;
                                  y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
                                  x1 = axisx.min;
          Severity: Major
          Found in client/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
          client/plugins/flot/jquery.flot.js on lines 2270..2281

          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 169.

          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 (y1 >= y2 && y1 > axisy.max) {
                                  if (y2 > axisy.max)
                                      continue;
                                  x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
                                  y1 = axisy.max;
          Severity: Major
          Found in client/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
          client/plugins/flot/jquery.flot.js on lines 2284..2295

          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 169.

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

                  function processData() {
                      var topSentry = Number.POSITIVE_INFINITY,
                          bottomSentry = Number.NEGATIVE_INFINITY,
                          fakeInfinity = Number.MAX_VALUE,
                          i, j, k, m, length,
          Severity: Major
          Found in client/plugins/flot/jquery.flot.js - About 6 hrs to fix

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

                                if (x1 >= x2 && x1 > axisx.max) {
                                    if (x2 > axisx.max)
                                        continue;
                                    y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                    x1 = axisx.max;
            Severity: Major
            Found in client/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
            client/plugins/flot/jquery.flot.js on lines 2381..2392

            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 167.

            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 (x1 >= x2 && x1 > axisx.max) {
                                    if (x2 > axisx.max)
                                        continue;
                                    y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                    x1 = axisx.max;
            Severity: Major
            Found in client/plugins/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
            client/plugins/flot/jquery.flot.js on lines 2298..2309

            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 167.

            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 getConnectionUrl has a Cognitive Complexity of 43 (exceeds 5 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);
            Severity: Minor
            Found in server/imports/core/connection/index.js - About 6 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 init has 164 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function init(plot) {
                    plot.hooks.processOptions.push(function (plot, options) {
                        $.each(plot.getAxes(), function(axisName, axis) {
            
                            var opts = axis.options;
            Severity: Major
            Found in client/plugins/flot/jquery.flot.time.js - About 6 hrs to fix

              Function Enums has 145 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Enums = function () {
                this.LOCAL_STORAGE_KEYS = {
                  MONGO_BINARY_INFO: 'mongoclient-mongo-binary-220-warn',
                  SHELL_COMMAND_HISTORY: 'mongoclient-shell-history',
                  AGGREGATE_COMMAND_HISTORY: 'mongoclient-aggregate-history',
              Severity: Major
              Found in client/imports/modules/enums/index.js - About 5 hrs to fix

                File roles.js has 402 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { Communicator, ReactivityProvider } from '/client/imports/facades';
                import { Notification, ErrorHandler, SessionManager, UIComponents } from '/client/imports/modules';
                import Helper from '/client/imports/helpers/helper';
                import UsermanagementHelper from './helper';
                import { _ } from 'meteor/underscore';
                Severity: Minor
                Found in client/imports/ui/user_management/roles.js - About 5 hrs to fix

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

                  import { Communicator, ReactivityProvider } from '/client/imports/facades';
                  import { UIComponents, ExtendedJSON, ErrorHandler, Notification } from '/client/imports/modules';
                  import Helper from '/client/imports/helpers/helper';
                  import moment from 'moment';
                  import $ from 'jquery';
                  Severity: Minor
                  Found in client/imports/ui/index_management/index.js - About 5 hrs to fix

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

                                if (options.x2axis) {
                                    options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
                                    options.xaxes[1].position = "top";
                                    // Override the inherit to allow the axis to auto-scale
                                    if (options.x2axis.min == null) {
                    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 841..851

                    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 145.

                    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 (options.y2axis) {
                                    options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
                                    options.yaxes[1].position = "right";
                                    // Override the inherit to allow the axis to auto-scale
                                    if (options.y2axis.min == null) {
                    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 830..840

                    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 145.

                    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 394 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { SessionManager, ErrorHandler, UIComponents, Notification } from '/client/imports/modules';
                    import { Communicator, ReactivityProvider } from '/client/imports/facades';
                    import Helper from '/client/imports/helpers/helper';
                    import moment from 'moment';
                    import $ from 'jquery';
                    Severity: Minor
                    Found in client/imports/ui/db_stats/index.js - About 5 hrs to fix

                      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
                          Severity
                          Category
                          Status
                          Source
                          Language