rsercano/mongoclient

View on GitHub
client/plugins/chosen_fork/chosen.jquery.js

Summary

Maintainability
F
1 mo
Test Coverage

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

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

          AbstractChosen.prototype.winnow_results = function() {
            var eregex, escapedSearchText, exact_result, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
            this.no_results_clear();
            results = 0;
            exact_result = false;
      Severity: Major
      Found in client/plugins/chosen_fork/chosen.jquery.js - About 2 hrs to fix

        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")) {
        Severity: Minor
        Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

          Function set_up_html has 39 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) {
          Severity: Minor
          Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

            Function keydown_checker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Chosen.prototype.keydown_checker = function(evt) {
                  var stroke, _ref1;
                  stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
                  this.search_field_scale();
                  if (stroke !== 8 && this.pending_backstroke) {
            Severity: Minor
            Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

              Function keyup_checker has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  AbstractChosen.prototype.keyup_checker = function(evt) {
                    var stroke, _ref;
                    stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
                    this.search_field_scale();
                    switch (stroke) {
              Severity: Minor
              Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

                Function result_add_option has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    AbstractChosen.prototype.result_add_option = function(option) {
                      var classes, option_el;
                      if (!option.search_match) {
                        return '';
                      }
                Severity: Minor
                Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

                  Function results_option_build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      AbstractChosen.prototype.results_option_build = function(options) {
                        var content, data, data_content, shown_results, _i, _len, _ref;
                        content = '';
                        shown_results = 0;
                        _ref = this.results_data;
                  Severity: Minor
                  Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

                    Function add_option has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
                          if (option.nodeName.toUpperCase() === "OPTION") {
                            if (option.text !== "") {
                              if (group_position != null) {
                                this.parsed[group_position].children += 1;
                    Severity: Minor
                    Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

                      Function set_default_values has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          AbstractChosen.prototype.set_default_values = function() {
                            var _this = this;
                            this.click_test_action = function(evt) {
                              return _this.test_active_click(evt);
                            };
                      Severity: Minor
                      Found in client/plugins/chosen_fork/chosen.jquery.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if (searchText.length) {
                                        startpos = option.search_text.search(zregex);
                                        text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
                                        option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
                                      }
                        Severity: Major
                        Found in client/plugins/chosen_fork/chosen.jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if (results_group != null) {
                                          results_group.group_match = true;
                                        }
                          Severity: Major
                          Found in client/plugins/chosen_fork/chosen.jquery.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
                                          option.search_match = true;
                                        }
                            Severity: Major
                            Found in client/plugins/chosen_fork/chosen.jquery.js - About 45 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return true;
                              Severity: Major
                              Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return document.documentMode >= 8;
                                Severity: Major
                                Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return false;
                                  Severity: Major
                                  Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return false;
                                    Severity: Major
                                    Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

                                      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

                                        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

                                          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

                                      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

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

                                        SelectParser.select_to_array = function(select) {
                                          var child, parser, _i, _len, _ref;
                                          parser = new SelectParser();
                                          _ref = select.childNodes;
                                          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                      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 109..118

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

                                      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.results_hide = function() {
                                            if (this.results_showing) {
                                              this.result_clear_highlight();
                                              this.container.removeClass("chosen-with-drop");
                                              this.form_field_jq.trigger("chosen:hiding_dropdown", {
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 2 hrs to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 933..942

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

                                      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.select_create_option = function(terms) {
                                            if ($.isFunction(this.create_option)) {
                                              return this.create_option.call(this, terms);
                                            } else {
                                              return this.select_append_option({
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 2 hrs to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1208..1217

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

                                      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, _len = styles.length; _i < _len; _i++) {
                                                style = styles[_i];
                                                style_block += style + ":" + this.search_field.css(style) + ";";
                                              }
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1346..1349

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

                                      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 (prev_sibs.length) {
                                                return this.result_do_highlight(prev_sibs.first());
                                              } else {
                                                if (this.choices_count() > 0) {
                                                  this.results_hide();
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1262..1269

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

                                      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.is_multiple) {
                                              this.search_choices = this.container.find('ul.chosen-choices').first();
                                              this.search_container = this.container.find('li.search-field').first();
                                            } else {
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 665..668

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

                                      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 {
                                              this.search_container = this.container.find('div.chosen-search').first();
                                              this.selected_item = this.container.find('.chosen-single').first();
                                            }
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 662..665

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

                                      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.form_field_label.length > 0) {
                                              return this.form_field_label.bind('click.chosen', function(evt) {
                                                if (_this.is_multiple) {
                                                  return _this.container_mousedown(evt);
                                                } else {
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 959..967

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

                                      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

                                          Chosen.prototype.container_mouseup = function(evt) {
                                            if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
                                              return this.results_reset(evt);
                                            }
                                          };
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 814..818

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

                                      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

                                            target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 987..987

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

                                      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.blur_test = function(evt) {
                                            if (!this.active_field && this.container.hasClass("chosen-container-active")) {
                                              return this.close_field();
                                            }
                                          };
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 832..836

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

                                      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

                                            target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 997..997

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                          Chosen.prototype.clear_backstroke = function() {
                                            if (this.pending_backstroke) {
                                              this.pending_backstroke.removeClass("search-choice-focus");
                                            }
                                            return this.pending_backstroke = null;
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 3 other locations - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 910..915
                                      client/plugins/chosen_fork/chosen.proto.js on lines 905..910
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1294..1299

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                          Chosen.prototype.result_clear_highlight = function() {
                                            if (this.result_highlight) {
                                              this.result_highlight.removeClass("highlighted");
                                            }
                                            return this.result_highlight = null;
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 3 other locations - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 1261..1266
                                      client/plugins/chosen_fork/chosen.proto.js on lines 905..910
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1294..1299

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                              if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                                                this.form_field_jq.trigger("chosen:maxselected", {
                                                  chosen: this
                                                });
                                                return false;
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 3 other locations - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 918..923
                                      client/plugins/chosen_fork/chosen.proto.js on lines 913..918
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1079..1084

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                            if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                                              this.form_field_jq.trigger("chosen:maxselected", {
                                                chosen: this
                                              });
                                              return false;
                                      Severity: Major
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 3 other locations - About 1 hr to fix
                                      client/plugins/chosen_fork/chosen.jquery.js on lines 1075..1080
                                      client/plugins/chosen_fork/chosen.proto.js on lines 913..918
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1079..1084

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

                                      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

                                            container_props = {
                                              'class': container_classes.join(' '),
                                              'style': "width: " + (this.container_width()) + ";",
                                              'title': this.form_field.title
                                            };
                                      Severity: Minor
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 55 mins to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 626..630

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

                                      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

                                            if (this.form_field.id.length) {
                                              container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
                                            }
                                      Severity: Minor
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 50 mins to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 631..633

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

                                      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

                                              case 9:
                                                if (this.results_showing && !this.is_multiple) {
                                                  this.result_select(evt);
                                                }
                                                this.mouse_on_container = false;
                                      Severity: Minor
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 40 mins to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1312..1317

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

                                      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

                                              if (this.is_multiple) {
                                                this.choice_build(item);
                                              } else {
                                                this.single_set_selected_text(this.choice_label(item));
                                              }
                                      Severity: Minor
                                      Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 30 mins to fix
                                      client/plugins/chosen_fork/chosen.proto.js on lines 1095..1099

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

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status