joshsoftware/code-curiosity

View on GitHub
app/assets/javascripts/bootstrap-multiselect.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/**
 * Bootstrap Multiselect (https://github.com/davidstutz/bootstrap-multiselect)
 * 
 * Apache License, Version 2.0:
 * Copyright (c) 2012 - 2015 David Stutz
Severity: Major
Found in app/assets/javascripts/bootstrap-multiselect.js - About 2 days to fix

    Function buildDropdownOptions has 165 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            buildDropdownOptions: function() {
    
                this.$select.children().each($.proxy(function(index, element) {
    
                    var $element = $(element);
    Severity: Major
    Found in app/assets/javascripts/bootstrap-multiselect.js - About 6 hrs to fix

      Function buildFilter has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              buildFilter: function() {
      
                  // Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
                  if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
                      var enableFilterLength = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering);
      Severity: Major
      Found in app/assets/javascripts/bootstrap-multiselect.js - About 2 hrs to fix

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

                    init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
                        var $element = $(element);
                        var config = ko.toJS(valueAccessor());
        
                        $element.multiselect(config);
        Severity: Major
        Found in app/assets/javascripts/bootstrap-multiselect.js - About 2 hrs to fix

          Function createOptionValue has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  createOptionValue: function(element) {
                      var $element = $(element);
                      if ($element.is(':selected')) {
                          $element.prop('selected', true);
                      }
          Severity: Minor
          Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

            Function searchTimeout has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                    this.searchTimeout = this.asyncFunction($.proxy(function() {
            
                                        if (this.query !== event.target.value) {
                                            this.query = event.target.value;
            
            
            Severity: Minor
            Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

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

                      refresh: function() {
                          $('option', this.$select).each($.proxy(function(index, element) {
                              var $input = $('li input', this.$ul).filter(function() {
                                  return $(this).val() === $(element).val();
                              });
              Severity: Minor
              Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

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

                        dataprovider: function(dataprovider) {
                            
                            var groupCounter = 0;
                            var $select = this.$select.empty();
                            
                Severity: Minor
                Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

                  Function buildSelectAll has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          buildSelectAll: function() {
                              if (typeof this.options.selectAllValue === 'number') {
                                  this.options.selectAllValue = this.options.selectAllValue.toString();
                              }
                              
                  Severity: Minor
                  Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

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

                            select: function(selectValues, triggerOnChange) {
                                if(!$.isArray(selectValues)) {
                                    selectValues = [selectValues];
                                }
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

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

                              selectAll: function (justVisible, triggerOnSelectAll) {
                                  var justVisible = typeof justVisible === 'undefined' ? true : justVisible;
                                  var allCheckboxes = $("li input[type='checkbox']:enabled", this.$ul);
                                  var visibleCheckboxes = allCheckboxes.filter(":visible");
                                  var allCheckboxesCount = allCheckboxes.length;
                      Severity: Minor
                      Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

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

                            function Multiselect(select, options) {
                        
                                this.$select = $(select);
                                
                                // Placeholder via data attributes
                        Severity: Minor
                        Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

                          Function buttonText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      buttonText: function(options, select) {
                                          if (options.length === 0) {
                                              return this.nonSelectedText;
                                          }
                                          else if (this.allSelectedText 
                          Severity: Minor
                          Found in app/assets/javascripts/bootstrap-multiselect.js - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                    if ($(element).hasClass('multiselect-group')) {
                                                                        // Remember group status.
                                                                        currentGroup = element;
                                                                        currentGroupVisible = showElement;
                                                                    }
                            Severity: Major
                            Found in app/assets/javascripts/bootstrap-multiselect.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) {
                                                                          showElement = true;
                                                                      }
                                                                      else if (filterCandidate.indexOf(this.query) > -1) {
                                                                          showElement = true;
                              Severity: Major
                              Found in app/assets/javascripts/bootstrap-multiselect.js - About 45 mins to fix

                                Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                            init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
                                Severity: Minor
                                Found in app/assets/javascripts/bootstrap-multiselect.js - About 35 mins to fix

                                  Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                              update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-multiselect.js - About 35 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                        return selected.substr(0, selected.length - 2);
                                    Severity: Major
                                    Found in app/assets/javascripts/bootstrap-multiselect.js - About 30 mins to fix

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

                                                      if (options.length === 0) {
                                                          return this.nonSelectedText;
                                                      }
                                                      else {
                                                          var selected = '';
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 209..222

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 121.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                      else if (options.length > this.numberDisplayed) {
                                                          return options.length + ' ' + this.nSelectedText;
                                                      }
                                                      else {
                                                          var selected = '';
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 232..244

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 121.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                      if (allBindings.has('value')) {
                                                          var value = allBindings.get('value');
                                                          if (ko.isObservable(value)) {
                                                              ko.computed({
                                                                  read: function() {
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 95..108

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

                                      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 (allBindings.has('selectedOptions')) {
                                                          var selectedOptions = allBindings.get('selectedOptions');
                                                          if (ko.isObservable(selectedOptions)) {
                                                              ko.computed({
                                                                  read: function() {
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 78..91

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

                                      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

                                              getInputByValue: function (value) {
                                      
                                                  var checkboxes = $('li input', this.$ul);
                                                  var valueToCompare = value.toString();
                                      
                                      
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1336..1347

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

                                      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

                                              getOptionByValue: function (value) {
                                      
                                                  var options = $('option', this.$select);
                                                  var valueToCompare = value.toString();
                                      
                                      
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1355..1366

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

                                      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

                                                              $tag.append($('<option/>').attr({
                                                                  value: subOption.value,
                                                                  label: subOption.label || subOption.value,
                                                                  title: subOption.title,
                                                                  selected: !!subOption.selected,
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 2 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1219..1225

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

                                      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

                                                          $tag = $('<option/>').attr({
                                                              value: option.value,
                                                              label: option.label || option.value,
                                                              title: option.title,
                                                              selected: !!option.selected,
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 2 hrs to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1209..1215

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

                                      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

                                                      $("option:enabled", this.$select).filter(function(index) {
                                                          return $.inArray($(this).val(), values) !== -1;
                                                      }).prop('selected', false);
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1113..1115

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

                                      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

                                                      $("option:enabled", this.$select).filter(function(index) {
                                                          return $.inArray($(this).val(), values) !== -1;
                                                      }).prop('selected', true);
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1141..1143

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

                                      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 ($(element).is(':selected')) {
                                                          $input.prop('checked', true);
                                      
                                                          if (this.options.selectedClass) {
                                                              $input.closest('li')
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 952..959

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

                                                      else {
                                                          $input.prop('checked', false);
                                      
                                                          if (this.options.selectedClass) {
                                                              $input.closest('li')
                                      Severity: Major
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 944..951

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

                                              disable: function() {
                                                  this.$select.prop('disabled', true);
                                                  this.$button.prop('disabled', true)
                                                      .addClass('disabled');
                                              },
                                      Severity: Minor
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 50 mins to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1237..1241

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

                                      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

                                              enable: function() {
                                                  this.$select.prop('disabled', false);
                                                  this.$button.prop('disabled', false)
                                                      .removeClass('disabled');
                                              },
                                      Severity: Minor
                                      Found in app/assets/javascripts/bootstrap-multiselect.js and 1 other location - About 50 mins to fix
                                      app/assets/javascripts/bootstrap-multiselect.js on lines 1246..1250

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

                                      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