aimer1124/JianshuSpider

View on GitHub
public/js/bootstrap-select.js

Summary

Maintainability
F
2 wks
Test Coverage

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

/*!
 * Bootstrap-select v1.11.2 (http://silviomoreto.github.io/bootstrap-select)
 *
 * Copyright 2013-2016 bootstrap-select
 * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
Severity: Major
Found in public/js/bootstrap-select.js - About 4 days to fix

    Function keydown has 183 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        keydown: function (e) {
          var $this = $(this),
              $parent = $this.is('input') ? $this.parent().parent() : $this.parent(),
              $items,
              that = $parent.data('this'),
    Severity: Major
    Found in public/js/bootstrap-select.js - About 7 hrs to fix

      Function clickListener has 158 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          clickListener: function () {
            var that = this,
                $document = $(document);
      
            this.$newElement.on('touchstart.dropdown', '.dropdown-menu', function (e) {
      Severity: Major
      Found in public/js/bootstrap-select.js - About 6 hrs to fix

        Function setSize has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setSize: function () {
              this.findLis();
              this.liHeight();
        
              if (this.options.header) this.$menu.css('padding-top', 0);
        Severity: Major
        Found in public/js/bootstrap-select.js - About 4 hrs to fix

          Function createLi has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              createLi: function () {
                var that = this,
                    _li = [],
                    optID = 0,
                    titleOption = document.createElement('option'),
          Severity: Major
          Found in public/js/bootstrap-select.js - About 4 hrs to fix

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

                init: function () {
                  var that = this,
                      id = this.$element.attr('id');
            
                  this.$element.addClass('bs-select-hidden');
            Severity: Major
            Found in public/js/bootstrap-select.js - About 2 hrs to fix

              Function liHeight has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  liHeight: function (refresh) {
                    if (!refresh && (this.options.size === false || this.sizeInfo)) return;
              
                    var newElement = document.createElement('div'),
                        menu = document.createElement('div'),
              Severity: Major
              Found in public/js/bootstrap-select.js - About 2 hrs to fix

                Function liveSearchListener has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    liveSearchListener: function () {
                      var that = this,
                          $no_results = $('<li class="no-results"></li>');
                
                      this.$button.on('click.dropdown.data-api touchstart.dropdown.data-api', function () {
                Severity: Major
                Found in public/js/bootstrap-select.js - About 2 hrs to fix

                  Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      render: function (updateLi) {
                        var that = this,
                            notDisabled;
                  
                        //Update the LI to match the SELECT
                  Severity: Major
                  Found in public/js/bootstrap-select.js - About 2 hrs to fix

                    Function getSize has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            var getSize = function () {
                              var minHeight,
                                  hasClass = function (className, include) {
                                    return function (element) {
                                        if (include) {
                    Severity: Minor
                    Found in public/js/bootstrap-select.js - About 1 hr to fix

                      Function createDropdown has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createDropdown: function () {
                            // Options
                            // If we are multiple or showTick option is set, then add the show-tick class
                            var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
                                inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '',
                      Severity: Minor
                      Found in public/js/bootstrap-select.js - About 1 hr to fix

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

                            selectPosition: function () {
                              this.$bsContainer = $('<div class="bs-container" />');
                        
                              var that = this,
                                  $container = $(this.options.container),
                        Severity: Minor
                        Found in public/js/bootstrap-select.js - About 1 hr to fix

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

                            function Plugin(option, event) {
                              // get the args of the outer function..
                              var args = arguments;
                              // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
                              // to get lost/corrupted in android 2.3 and IE9 #715 #775
                          Severity: Minor
                          Found in public/js/bootstrap-select.js - About 1 hr to fix

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

                              var Selectpicker = function (element, options, e) {
                                // bootstrap-select has been initialized - revert valHooks.select.set back to its original function
                                if (!valHooks.useDefault) {
                                  $.valHooks.select.set = valHooks._set;
                                  valHooks.useDefault = true;
                            Severity: Minor
                            Found in public/js/bootstrap-select.js - About 1 hr to fix

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

                                    var startsWith = function (search) {
                                      if (this == null) {
                                        throw new TypeError();
                                      }
                                      var string = String(this);
                              Severity: Minor
                              Found in public/js/bootstrap-select.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                      if (!isActive && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode >= 65 && e.keyCode <= 90)) {
                                        if (!that.options.container) {
                                          that.setSize();
                                          that.$menu.parent().addClass('open');
                                          isActive = true;
                                Severity: Major
                                Found in public/js/bootstrap-select.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  if (maxOptions && maxOptions == 1) {
                                                    $options.prop('selected', false);
                                                    $option.prop('selected', true);
                                                    that.$menuInner.find('.selected').removeClass('selected');
                                                    that.setSelected(clickedIndex, true);
                                  Severity: Major
                                  Found in public/js/bootstrap-select.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                  if ($prev[i].tagName === 'OPTGROUP') {
                                                    var optGroupDistance = 0;
                                    
                                                    // loop through the options in between the current option and the optgroup
                                                    // and check if they are hidden or disabled
                                    Severity: Major
                                    Found in public/js/bootstrap-select.js - About 45 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                            if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) {
                                              that.$menu.parent().removeClass('open');
                                              if (that.options.container) that.$newElement.removeClass('open');
                                              that.$button.focus();
                                            }
                                      Severity: Major
                                      Found in public/js/bootstrap-select.js - About 40 mins to fix

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

                                          $.expr.pseudos.aicontains = function (obj, index, meta) {
                                            var $obj = $(obj);
                                            var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
                                            return haystack.includes(meta[3].toUpperCase());
                                          };
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 217..221

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

                                        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

                                          $.expr.pseudos.aibegins = function (obj, index, meta) {
                                            var $obj = $(obj);
                                            var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
                                            return haystack.startsWith(meta[3].toUpperCase());
                                          };
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 210..214

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

                                        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

                                                    horiz: parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +
                                                          parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +
                                                          parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +
                                                          parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 872..875

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

                                        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

                                                    vert: parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +
                                                          parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
                                                          parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
                                                          parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 876..879

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

                                        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

                                          $.expr.pseudos.icontains = function (obj, index, meta) {
                                            var $obj = $(obj);
                                            var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();
                                            return haystack.includes(meta[3].toUpperCase());
                                          };
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 203..207

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

                                        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

                                          $.expr.pseudos.ibegins = function (obj, index, meta) {
                                            var $obj = $(obj);
                                            var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();
                                            return haystack.startsWith(meta[3].toUpperCase());
                                          };
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                                        public/js/bootstrap-select.js on lines 196..200

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

                                        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

                                                  doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null;
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 2 hrs to fix
                                        public/js/bootstrap-select.js on lines 832..832

                                        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

                                                  actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 2 hrs to fix
                                        public/js/bootstrap-select.js on lines 833..833

                                        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

                                          $(window).on('load.bs.select.data-api', function () {
                                            $('.selectpicker').each(function () {
                                              var $selectpicker = $(this);
                                              Plugin.call($selectpicker, $selectpicker.data());
                                            })
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap.js on lines 1952..1957

                                        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

                                              var defineProperty = (function () {
                                                // IE 8 only supports `Object.defineProperty` on DOM elements
                                                try {
                                                  var object = {};
                                                  var $defineProperty = Object.defineProperty;
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 32..41

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

                                        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

                                              var defineProperty = (function () {
                                                // IE 8 only supports `Object.defineProperty` on DOM elements
                                                try {
                                                  var object = {};
                                                  var $defineProperty = Object.defineProperty;
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 82..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 69.

                                        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

                                                    vert: menuPadding.vert +
                                                          parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
                                                          parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2,
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 885..887

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

                                        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

                                                    horiz: menuPadding.horiz +
                                                          parseInt(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) +
                                                          parseInt(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 882..884

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

                                        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 (maxOptionsGrp && maxReachedGrp) {
                                                            $notify.append($('<div>' + maxTxtGrp + '</div>'));
                                                            triggerChange = false;
                                                            that.$element.trigger('maxReachedGrp.bs.select');
                                                          }
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 1309..1313

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

                                        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 (maxOptions && maxReached) {
                                                            $notify.append($('<div>' + maxTxt + '</div>'));
                                                            triggerChange = false;
                                                            that.$element.trigger('maxReached.bs.select');
                                                          }
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 1315..1319

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

                                        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 (defineProperty) {
                                                defineProperty(String.prototype, 'includes', {
                                                  'value': includes,
                                                  'configurable': true,
                                                  'writable': true
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 123..131

                                        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

                                              if (defineProperty) {
                                                defineProperty(String.prototype, 'startsWith', {
                                                  'value': startsWith,
                                                  'configurable': true,
                                                  'writable': true
                                        Severity: Major
                                        Found in public/js/bootstrap-select.js and 1 other location - About 1 hr to fix
                                        public/js/bootstrap-select.js on lines 67..75

                                        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

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

                                                if (that.options.liveSearch) {
                                                  that.$searchbox.focus();
                                                } else {
                                                  that.$button.focus();
                                                }
                                        Severity: Minor
                                        Found in public/js/bootstrap-select.js and 1 other location - About 35 mins to fix
                                        public/js/bootstrap-select.js on lines 1366..1370

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

                                        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 (that.options.liveSearch) {
                                                  that.$searchbox.focus();
                                                } else {
                                                  that.$button.focus();
                                                }
                                        Severity: Minor
                                        Found in public/js/bootstrap-select.js and 1 other location - About 35 mins to fix
                                        public/js/bootstrap-select.js on lines 1382..1386

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

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

                                          $.fn.selectpicker.noConflict = function () {
                                            $.fn.selectpicker = old;
                                            return this;
                                          };
                                        Severity: Minor
                                        Found in public/js/bootstrap-select.js and 2 other locations - About 30 mins to fix
                                        public/js/bootstrap.js on lines 1658..1661
                                        public/js/bootstrap.js on lines 1778..1781

                                        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