mongoclient/mongoclient

View on GitHub

Showing 698 of 698 total issues

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

  AbstractChosen = (function() {
    function AbstractChosen(form_field, options) {
      this.form_field = form_field;
      this.options = options != null ? options : {};
      if (!AbstractChosen.browser_is_supported()) {
Severity: Major
Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 mo to fix
client/plugins/chosen_fork/chosen.proto.js on lines 120..592

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

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

  AbstractChosen = (function() {
    function AbstractChosen(form_field, options) {
      this.form_field = form_field;
      this.options = options != null ? options : {};
      if (!AbstractChosen.browser_is_supported()) {
Severity: Major
Found in client/plugins/chosen_fork/chosen.proto.js and 1 other location - About 1 mo to fix
client/plugins/chosen_fork/chosen.jquery.js on lines 120..592

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

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

    function Plot(placeholder, data_, options_, plugins) {
        // data is on the form:
        //   [ series1, series2 ... ]
        // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
        // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
Severity: Major
Found in client/plugins/flot/jquery.flot.js - About 1 wk to fix

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

    /* Javascript plotting library for jQuery, version 0.8.3.
    
    Copyright (c) 2007-2014 IOLA and Ole Laursen.
    Licensed under the MIT license.
    
    
    Severity: Major
    Found in client/plugins/flot/jquery.flot.js - About 6 days to fix

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

        SelectParser = (function() {
          function SelectParser() {
            this.options_index = 0;
            this.parsed = [];
          }
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 4 days to fix
      client/plugins/chosen_fork/chosen.proto.js on lines 18..107

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

      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

        SelectParser = (function() {
          function SelectParser() {
            this.options_index = 0;
            this.parsed = [];
          }
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.proto.js and 1 other location - About 4 days to fix
      client/plugins/chosen_fork/chosen.jquery.js on lines 18..107

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

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

        this.Chosen = (function(_super) {
          __extends(Chosen, _super);
      
          function Chosen() {
            _ref = Chosen.__super__.constructor.apply(this, arguments);
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.proto.js - About 3 days to fix

        File chosen.proto.js has 1260 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
        Chosen, a Select Box Enhancer for jQuery and Prototype
        by Patrick Filler for Harvest, http://getharvest.com
        
        Version 1.5.1
        Severity: Major
        Found in client/plugins/chosen_fork/chosen.proto.js - About 3 days to fix

          File chosen.jquery.js has 1227 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
          Chosen, a Select Box Enhancer for jQuery and Prototype
          by Patrick Filler for Harvest, http://getharvest.com
          
          Version 1.5.1
          Severity: Major
          Found in client/plugins/chosen_fork/chosen.jquery.js - About 3 days to fix

            File bootstrap-colorpicker.js has 1155 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * Bootstrap Colorpicker v2.4.0
             * https://itsjavi.com/bootstrap-colorpicker/
             *
             * Originally written by (c) 2012 Stefan Petre
            Severity: Major
            Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js - About 2 days to fix

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

                  function init(plot) {
              
                      var canvas = null,
                          target = null,
                          options = null,
              Severity: Major
              Found in client/plugins/flot/jquery.flot.pie.js - About 2 days to fix

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

                  addInheritRole() {
                    const db = $('#cmbDatabasesForInheritRole').val();
                    const role = $('#cmbRolesForDBForInheritedRole').val();
                
                    if (!db) {
                Severity: Major
                Found in client/imports/ui/user_management/roles.js and 1 other location - About 1 day to fix
                client/imports/ui/user_management/users.js on lines 46..72

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

                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

                  addRoleToUser() {
                    const db = $('#cmbDatabasesForAddRoleToUser').val();
                    const roleName = $('#inputAddRoleToUserRolename').val();
                    if (!db) {
                      Notification.error('db-required');
                Severity: Major
                Found in client/imports/ui/user_management/users.js and 1 other location - About 1 day to fix
                client/imports/ui/user_management/roles.js on lines 45..72

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

                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

                  getHelpBlockForSelectedQuery() {
                    switch (SessionManager.get(SessionManager.strSessionSelectedQuery)) {
                      case Enums.QUERY_TYPES.FINDONE_AND_REPLACE:
                        return Helper.translate({ key: 'findone_replace_help_block' });
                
                
                client/imports/views/pages/admin_queries/admin_queries.js on lines 76..111

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

                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

                  getHelpBlockForSelectedQuery() {
                    switch (SessionManager.get(SessionManager.strSessionSelectedQuery)) {
                      case Enums.ADMIN_QUERY_TYPES.ADD_USER:
                        return Helper.translate({ key: 'add_user_help_block' });
                
                
                Severity: Major
                Found in client/imports/views/pages/admin_queries/admin_queries.js and 1 other location - About 1 day to fix
                client/imports/views/pages/browse_collection/browse_collection.js on lines 107..142

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

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

                import { Meteor } from 'meteor/meteor';
                import { Enums, Notification, ExtendedJSON, UIComponents, SessionManager } from '/client/imports/modules';
                import { Connection, QueryRender, QueryingOptions } from '/client/imports/ui';
                import { Communicator } from '/client/imports/facades';
                import { _ } from 'meteor/underscore';
                Severity: Major
                Found in client/imports/ui/querying/querying.js - About 1 day to fix

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

                              for (i = 0; i < axisCount; ++i) {
                  
                                  axisOptions = options.yaxes[i];
                                  if (axisOptions && !axisOptions.tickColor) {
                                      axisOptions.tickColor = axisOptions.color;
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.js and 1 other location - About 1 day to fix
                  client/plugins/flot/jquery.flot.js on lines 782..801

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

                  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 < axisCount; ++i) {
                  
                                  axisOptions = options.xaxes[i];
                                  if (axisOptions && !axisOptions.tickColor) {
                                      axisOptions.tickColor = axisOptions.color;
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.js and 1 other location - About 1 day to fix
                  client/plugins/flot/jquery.flot.js on lines 804..823

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

                  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 jquery.flot.pie.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* Flot plugin for rendering pie charts.
                  
                  Copyright (c) 2007-2014 IOLA and Ole Laursen.
                  Licensed under the MIT license.
                  
                  
                  Severity: Major
                  Found in client/plugins/flot/jquery.flot.pie.js - About 1 day to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language