Semantic-Org/Semantic-UI

View on GitHub
src/definitions/modules/dropdown.js

Summary

Maintainability
F
1 mo
Test Coverage

Function dropdown has 3525 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.dropdown = function(parameters) {
  var
    $allModules    = $(this),
    $document      = $(document),

Severity: Major
Found in src/definitions/modules/dropdown.js - About 2 wks to fix

    File dropdown.js has 3743 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * # Semantic UI - Dropdown
     * http://github.com/semantic-org/semantic-ui/
     *
     *
    Severity: Major
    Found in src/definitions/modules/dropdown.js - About 1 wk to fix

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

                keydown: function(event) {
                  var
                    pressedKey    = event.which,
                    isShortcutKey = module.is.inObject(pressedKey, keys)
                  ;
      Severity: Major
      Found in src/definitions/modules/dropdown.js - About 6 hrs to fix

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

                    keydown: function(event) {
                      var
                        pressedKey    = event.which,
                        isShortcutKey = module.is.inObject(pressedKey, keys)
                      ;
        Severity: Major
        Found in src/definitions/modules/dropdown.js - About 4 hrs to fix

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

                    selected: function(value, $selectedItem) {
                      var
                        isMultiple = module.is.multiple(),
                        $userSelectedItem
                      ;
          Severity: Major
          Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

            Function mouseEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      mouseEvents: function() {
                        module.verbose('Binding mouse events');
                        if(module.is.multiple()) {
                          $module
                            .on('click'   + eventNamespace, selector.label,  module.event.label.click)
            Severity: Major
            Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

              Function filter has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      filter: function(query) {
                        var
                          searchTerm = (query !== undefined)
                            ? query
                            : module.get.query(),
              Severity: Major
              Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

                Function filterItems has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        filterItems: function(query) {
                          var
                            searchTerm = (query !== undefined)
                              ? query
                              : module.get.query(),
                Severity: Major
                Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

                  Function item has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            item: function(value, strict) {
                              var
                                $selectedItem = false,
                                shouldSearch,
                                isMultiple
                  Severity: Major
                  Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

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

                              value: function(value, text, $selected) {
                                var
                                  escapedValue = module.escape.value(value),
                                  hasInput     = ($input.length > 0),
                                  currentValue = module.get.values(),
                    Severity: Major
                    Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

                      Function invoke has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              invoke: function(query, passedArguments, context) {
                                var
                                  object = instance,
                                  maxDepth,
                                  found,
                      Severity: Major
                      Found in src/definitions/modules/dropdown.js - About 2 hrs to fix

                        Function show has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                  show: function(callback, $subMenu) {
                                    var
                                      $currentMenu = $subMenu || $menu,
                                      start = ($subMenu)
                                        ? function() {}
                        Severity: Minor
                        Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                          Function scrollPage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  scrollPage: function(direction, $selectedItem) {
                                    var
                                      $currentItem  = $selectedItem || module.get.selectedItem(),
                                      $menu         = $currentItem.closest(selector.menu),
                                      menuHeight    = $menu.outerHeight(),
                          Severity: Minor
                          Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                            Function userSuggestion has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                      userSuggestion: function(value) {
                                        var
                                          $addition         = $menu.children(selector.addition),
                                          $existingItem     = module.get.item(value),
                                          alreadyHasValue   = $existingItem && $existingItem.not(selector.addition).length,
                            Severity: Minor
                            Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                              Function hide has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                        hide: function(callback, $subMenu) {
                                          var
                                            $currentMenu = $subMenu || $menu,
                                            duration = ($subMenu)
                                              ? (settings.duration * 0.9)
                              Severity: Minor
                              Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                Function selectValues has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                          selectValues: function() {
                                            var
                                              select = {}
                                            ;
                                            select.values = [];
                                Severity: Minor
                                Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                            select: function() {
                                              var
                                                selectValues  = module.get.selectValues()
                                              ;
                                              module.debug('Dropdown initialized on a select', selectValues);
                                  Severity: Minor
                                  Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                              openDownward: function($subMenu) {
                                                var
                                                  $currentMenu    = $subMenu || $menu,
                                                  canOpenDownward = true,
                                                  onScreen        = {},
                                    Severity: Minor
                                    Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                      Function queryRemote has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              queryRemote: function(query, callback) {
                                                var
                                                  apiSettings = {
                                                    errorDuration : false,
                                                    cache         : 'local',
                                      Severity: Minor
                                      Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                    if(isShortcutKey) {
                                                      var
                                                        $currentlySelected = $item.not(selector.unselectable).filter('.' + className.selected).eq(0),
                                                        $activeItem        = $menu.children('.' + className.active).eq(0),
                                                        $selectedItem      = ($currentlySelected.length > 0)
                                        Severity: Critical
                                        Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                    selected: function(value, $selectedItem) {
                                                      $selectedItem = (settings.allowAdditions)
                                                        ? $selectedItem || module.get.itemWithAdditions(value)
                                                        : $selectedItem || module.get.item(value)
                                                      ;
                                          Severity: Minor
                                          Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                            Function scrollPosition has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                      scrollPosition: function($item, forceScroll) {
                                                        var
                                                          edgeTolerance = 5,
                                                          $menu,
                                                          hasActive,
                                            Severity: Minor
                                            Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                              Function label has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                        label: function(value, text, shouldAnimate) {
                                                          var
                                                            $next  = module.is.searchSelection()
                                                              ? $search
                                                              : $text,
                                              Severity: Minor
                                              Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                                Function value has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                          value: function(addedValue, addedText, $selectedItem) {
                                                            var
                                                              currentValue = module.get.values(),
                                                              newValue
                                                            ;
                                                Severity: Minor
                                                Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                            userChoice: function(values) {
                                                              var
                                                                $userChoices,
                                                                $userChoice,
                                                                isUserValue,
                                                  Severity: Minor
                                                  Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                afterFiltered = function() {
                                                                  if(module.is.multiple()) {
                                                                    module.filterActive();
                                                                  }
                                                                  if(query || (!query && module.get.activeItem().length == 0)) {
                                                    Severity: Minor
                                                    Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                openRightward: function($subMenu) {
                                                                  var
                                                                    $currentMenu     = $subMenu || $menu,
                                                                    canOpenRightward = true,
                                                                    isOffscreenRight = false,
                                                      Severity: Minor
                                                      Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                  selectedLetter: function(letter) {
                                                                    var
                                                                      $selectedItem         = $item.filter('.' + className.selected),
                                                                      alreadySelectedLetter = $selectedItem.length > 0 && module.has.firstLetter($selectedItem, letter),
                                                                      $nextValue            = false,
                                                        Severity: Minor
                                                        Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                                          Function click has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                      click: function (event, skipRefocus) {
                                                                        var
                                                                          $choice        = $(this),
                                                                          $target        = (event)
                                                                            ? $(event.target)
                                                          Severity: Minor
                                                          Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                                            Function show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    show: function(callback) {
                                                                      callback = $.isFunction(callback)
                                                                        ? callback
                                                                        : function(){}
                                                                      ;
                                                            Severity: Minor
                                                            Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                        text: function(text) {
                                                                          if(settings.action !== 'select') {
                                                                            if(settings.action == 'combo') {
                                                                              module.debug('Changing combo button text', text, $combo);
                                                                              if(settings.preserveHTML) {
                                                              Severity: Minor
                                                              Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                          display: function() {
                                                                            var
                                                                              title = settings.name + ':',
                                                                              totalTime = 0
                                                                            ;
                                                                Severity: Minor
                                                                Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                                                            labels: function($labels) {
                                                                              $labels = $labels || $module.find(selector.label);
                                                                              module.verbose('Removing labels', $labels);
                                                                              $labels
                                                                                .each(function(){
                                                                  Severity: Minor
                                                                  Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                        if(settings.selectOnKeydown && module.is.single()) {
                                                                                          module.set.selectedItem($nextItem);
                                                                                        }
                                                                    Severity: Major
                                                                    Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if(isSubMenuItem) {
                                                                                            module.verbose('Left key pressed, closing sub-menu');
                                                                                            module.animate.hide(false, $parentMenu);
                                                                                            $selectedItem
                                                                                              .removeClass(className.selected)
                                                                      Severity: Major
                                                                      Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                            if(hasSubMenu) {
                                                                                              module.verbose('Right key pressed, opening sub-menu');
                                                                                              module.animate.show(false, $subMenu);
                                                                                              $selectedItem
                                                                                                .removeClass(className.selected)
                                                                        Severity: Major
                                                                        Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if(isLastLabel) {
                                                                                                if(isSearch) {
                                                                                                  if(!isFocusedOnSearch) {
                                                                                                    module.focusSearch();
                                                                                                  }
                                                                          Severity: Major
                                                                          Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                if(module.is.searchSelection()) {
                                                                                                  module.remove.searchTerm();
                                                                                                }
                                                                            Severity: Major
                                                                            Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                  if(settings.selectOnKeydown && module.is.single()) {
                                                                                                    module.set.selectedItem($nextItem);
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if(!event.shiftKey) {
                                                                                                      module.verbose('Selecting next label');
                                                                                                      $label.removeClass(className.active);
                                                                                                    }
                                                                                                    else {
                                                                                Severity: Major
                                                                                Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                    if(hasActiveLabel) {
                                                                                                      module.verbose('Removing active labels');
                                                                                                      if(isLastLabel) {
                                                                                                        if(isSearch && !isFocusedOnSearch) {
                                                                                                          module.focusSearch();
                                                                                  Severity: Major
                                                                                  Found in src/definitions/modules/dropdown.js - About 45 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                                        return true;
                                                                                    Severity: Major
                                                                                    Found in src/definitions/modules/dropdown.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                          return true;
                                                                                      Severity: Major
                                                                                      Found in src/definitions/modules/dropdown.js - About 30 mins to fix

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

                                                                                                invoke: function(query, passedArguments, context) {
                                                                                                  var
                                                                                                    object = instance,
                                                                                                    maxDepth,
                                                                                                    found,
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 11 other locations - About 2 days to fix
                                                                                        src/definitions/behaviors/api.js on lines 950..1003
                                                                                        src/definitions/behaviors/visibility.js on lines 1132..1185
                                                                                        src/definitions/globals/site.js on lines 351..404
                                                                                        src/definitions/modules/accordion.js on lines 482..535
                                                                                        src/definitions/modules/checkbox.js on lines 698..751
                                                                                        src/definitions/modules/dimmer.js on lines 580..633
                                                                                        src/definitions/modules/embed.js on lines 501..554
                                                                                        src/definitions/modules/nag.js on lines 365..418
                                                                                        src/definitions/modules/progress.js on lines 769..822
                                                                                        src/definitions/modules/sidebar.js on lines 873..926
                                                                                        src/definitions/modules/tab.js on lines 802..855

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

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

                                                                                                performance: {
                                                                                                  log: function(message) {
                                                                                                    var
                                                                                                      currentTime,
                                                                                                      executionTime,
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 10 other locations - About 2 days to fix
                                                                                        src/definitions/behaviors/visibility.js on lines 1081..1131
                                                                                        src/definitions/modules/accordion.js on lines 431..481
                                                                                        src/definitions/modules/checkbox.js on lines 647..697
                                                                                        src/definitions/modules/modal.js on lines 826..876
                                                                                        src/definitions/modules/nag.js on lines 314..364
                                                                                        src/definitions/modules/popup.js on lines 1200..1250
                                                                                        src/definitions/modules/progress.js on lines 718..768
                                                                                        src/definitions/modules/sidebar.js on lines 822..872
                                                                                        src/definitions/modules/sticky.js on lines 780..830
                                                                                        src/definitions/modules/tab.js on lines 751..801

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 445.

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

                                                                                                setting: function(name, value) {
                                                                                                  module.debug('Changing setting', name, value);
                                                                                                  if( $.isPlainObject(name) ) {
                                                                                                    $.extend(true, settings, name);
                                                                                                  }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 13 other locations - About 4 hrs to fix
                                                                                        src/definitions/behaviors/api.js on lines 843..859
                                                                                        src/definitions/modules/accordion.js on lines 372..388
                                                                                        src/definitions/modules/checkbox.js on lines 591..607
                                                                                        src/definitions/modules/dimmer.js on lines 470..486
                                                                                        src/definitions/modules/embed.js on lines 391..407
                                                                                        src/definitions/modules/modal.js on lines 770..786
                                                                                        src/definitions/modules/nag.js on lines 258..274
                                                                                        src/definitions/modules/progress.js on lines 662..678
                                                                                        src/definitions/modules/rating.js on lines 266..282
                                                                                        src/definitions/modules/shape.js on lines 673..689
                                                                                        src/definitions/modules/sidebar.js on lines 766..782
                                                                                        src/definitions/modules/tab.js on lines 695..711
                                                                                        src/definitions/modules/transition.js on lines 836..852

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

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

                                                                                                verbose: function() {
                                                                                                  if(!settings.silent && settings.verbose && settings.debug) {
                                                                                                    if(settings.performance) {
                                                                                                      module.performance.log(arguments);
                                                                                                    }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 18 other locations - About 4 hrs to fix
                                                                                        src/definitions/behaviors/api.js on lines 882..892
                                                                                        src/definitions/behaviors/form.js on lines 1070..1080
                                                                                        src/definitions/behaviors/visibility.js on lines 1064..1074
                                                                                        src/definitions/modules/accordion.js on lines 414..424
                                                                                        src/definitions/modules/checkbox.js on lines 630..640
                                                                                        src/definitions/modules/dimmer.js on lines 509..519
                                                                                        src/definitions/modules/embed.js on lines 430..440
                                                                                        src/definitions/modules/modal.js on lines 809..819
                                                                                        src/definitions/modules/nag.js on lines 297..307
                                                                                        src/definitions/modules/popup.js on lines 1183..1193
                                                                                        src/definitions/modules/progress.js on lines 701..711
                                                                                        src/definitions/modules/rating.js on lines 305..315
                                                                                        src/definitions/modules/search.js on lines 1067..1077
                                                                                        src/definitions/modules/shape.js on lines 712..722
                                                                                        src/definitions/modules/sidebar.js on lines 805..815
                                                                                        src/definitions/modules/sticky.js on lines 763..773
                                                                                        src/definitions/modules/tab.js on lines 734..744
                                                                                        src/definitions/modules/transition.js on lines 875..885

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

                                                                                        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(value.search(beginsWithRegExp) !== -1) {
                                                                                                            results.push(this);
                                                                                                            return true;
                                                                                                          }
                                                                                                          else if (settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, value)) {
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 4 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 807..818

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 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(text.search(beginsWithRegExp) !== -1) {
                                                                                                            results.push(this);
                                                                                                            return true;
                                                                                                          }
                                                                                                          else if (settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, text)) {
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 4 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 822..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 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

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

                                                                                                debug: function() {
                                                                                                  if(!settings.silent && settings.debug) {
                                                                                                    if(settings.performance) {
                                                                                                      module.performance.log(arguments);
                                                                                                    }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 18 other locations - About 4 hrs to fix
                                                                                        src/definitions/behaviors/api.js on lines 871..881
                                                                                        src/definitions/behaviors/form.js on lines 1059..1069
                                                                                        src/definitions/behaviors/visibility.js on lines 1053..1063
                                                                                        src/definitions/modules/accordion.js on lines 403..413
                                                                                        src/definitions/modules/checkbox.js on lines 619..629
                                                                                        src/definitions/modules/dimmer.js on lines 498..508
                                                                                        src/definitions/modules/embed.js on lines 419..429
                                                                                        src/definitions/modules/modal.js on lines 798..808
                                                                                        src/definitions/modules/nag.js on lines 286..296
                                                                                        src/definitions/modules/popup.js on lines 1172..1182
                                                                                        src/definitions/modules/progress.js on lines 690..700
                                                                                        src/definitions/modules/rating.js on lines 294..304
                                                                                        src/definitions/modules/search.js on lines 1056..1066
                                                                                        src/definitions/modules/shape.js on lines 701..711
                                                                                        src/definitions/modules/sidebar.js on lines 794..804
                                                                                        src/definitions/modules/sticky.js on lines 752..762
                                                                                        src/definitions/modules/tab.js on lines 723..733
                                                                                        src/definitions/modules/transition.js on lines 864..874

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

                                                                                        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

                                                                                                    calculations = {
                                                                                                      context: {
                                                                                                        offset     : ($context.get(0) === window)
                                                                                                          ? { top: 0, left: 0}
                                                                                                          : $context.offset(),
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 3 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3277..3289

                                                                                        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

                                                                                                    calculations = {
                                                                                                      context: {
                                                                                                        offset    : ($context.get(0) === window)
                                                                                                          ? { top: 0, left: 0}
                                                                                                          : $context.offset(),
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 3 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3322..3334

                                                                                        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

                                                                                                          if($nextItem.length === 0) {
                                                                                                            module.verbose('Down key pressed but reached bottom of current menu');
                                                                                                            event.preventDefault();
                                                                                                            return;
                                                                                                          }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 3 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1449..1466

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

                                                                                        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($visibleItems.index( $nextItem ) < 0) {
                                                                                                            module.verbose('Up key pressed but reached top of current menu');
                                                                                                            event.preventDefault();
                                                                                                            return;
                                                                                                          }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 3 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1476..1493

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

                                                                                        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

                                                                                                  search: for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
                                                                                                    var
                                                                                                      queryCharacter = query.charCodeAt(characterIndex)
                                                                                                    ;
                                                                                                    while(nextCharacterIndex < termLength) {
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 2 hrs to fix
                                                                                        src/definitions/modules/search.js on lines 674..684

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

                                                                                        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($.fn.transition !== undefined && $module.transition('is supported')) {
                                                                                                        $currentMenu
                                                                                                          .transition({
                                                                                                            animation  : transition + ' in',
                                                                                                            debug      : settings.debug,
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 2 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3437..3454

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

                                                                                        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($.fn.transition !== undefined && $module.transition('is supported')) {
                                                                                                        $currentMenu
                                                                                                          .transition({
                                                                                                            animation  : transition + ' out',
                                                                                                            duration   : settings.duration,
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 2 hrs to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3389..3406

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

                                                                                        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

                                                                                                trigger: {
                                                                                                  change: function() {
                                                                                                    var
                                                                                                      events       = document.createEvent('HTMLEvents'),
                                                                                                      inputElement = $input[0]
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 2 hrs to fix
                                                                                        src/definitions/modules/checkbox.js on lines 513..525

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 82.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                error: function() {
                                                                                                  if(!settings.silent) {
                                                                                                    module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
                                                                                                    module.error.apply(console, arguments);
                                                                                                  }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 18 other locations - About 2 hrs to fix
                                                                                        src/definitions/behaviors/api.js on lines 893..898
                                                                                        src/definitions/behaviors/form.js on lines 1081..1086
                                                                                        src/definitions/behaviors/visibility.js on lines 1075..1080
                                                                                        src/definitions/modules/accordion.js on lines 425..430
                                                                                        src/definitions/modules/checkbox.js on lines 641..646
                                                                                        src/definitions/modules/dimmer.js on lines 520..525
                                                                                        src/definitions/modules/embed.js on lines 441..446
                                                                                        src/definitions/modules/modal.js on lines 820..825
                                                                                        src/definitions/modules/nag.js on lines 308..313
                                                                                        src/definitions/modules/popup.js on lines 1194..1199
                                                                                        src/definitions/modules/progress.js on lines 712..717
                                                                                        src/definitions/modules/rating.js on lines 316..321
                                                                                        src/definitions/modules/search.js on lines 1078..1083
                                                                                        src/definitions/modules/shape.js on lines 723..728
                                                                                        src/definitions/modules/sidebar.js on lines 816..821
                                                                                        src/definitions/modules/sticky.js on lines 774..779
                                                                                        src/definitions/modules/tab.js on lines 745..750
                                                                                        src/definitions/modules/transition.js on lines 886..891

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

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

                                                                                              if(methodInvoked) {
                                                                                                if(instance === undefined) {
                                                                                                  module.initialize();
                                                                                                }
                                                                                                module.invoke(query);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 15 other locations - About 2 hrs to fix
                                                                                        src/definitions/behaviors/api.js on lines 1006..1017
                                                                                        src/definitions/modules/accordion.js on lines 537..548
                                                                                        src/definitions/modules/checkbox.js on lines 754..765
                                                                                        src/definitions/modules/dimmer.js on lines 638..649
                                                                                        src/definitions/modules/embed.js on lines 557..568
                                                                                        src/definitions/modules/modal.js on lines 932..943
                                                                                        src/definitions/modules/nag.js on lines 421..432
                                                                                        src/definitions/modules/popup.js on lines 1306..1317
                                                                                        src/definitions/modules/progress.js on lines 825..836
                                                                                        src/definitions/modules/rating.js on lines 430..441
                                                                                        src/definitions/modules/search.js on lines 1192..1203
                                                                                        src/definitions/modules/shape.js on lines 838..849
                                                                                        src/definitions/modules/sidebar.js on lines 930..941
                                                                                        src/definitions/modules/sticky.js on lines 886..897
                                                                                        src/definitions/modules/tab.js on lines 857..868

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

                                                                                                internal: function(name, value) {
                                                                                                  if( $.isPlainObject(name) ) {
                                                                                                    $.extend(true, module, name);
                                                                                                  }
                                                                                                  else if(value !== undefined) {
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 24 other locations - About 1 hr to fix
                                                                                        src/definitions/behaviors/api.js on lines 860..870
                                                                                        src/definitions/behaviors/form.js on lines 1037..1047
                                                                                        src/definitions/behaviors/form.js on lines 1048..1058
                                                                                        src/definitions/behaviors/visibility.js on lines 1031..1041
                                                                                        src/definitions/behaviors/visibility.js on lines 1042..1052
                                                                                        src/definitions/globals/site.js on lines 255..265
                                                                                        src/definitions/globals/site.js on lines 266..276
                                                                                        src/definitions/modules/checkbox.js on lines 608..618
                                                                                        src/definitions/modules/dimmer.js on lines 487..497
                                                                                        src/definitions/modules/embed.js on lines 408..418
                                                                                        src/definitions/modules/modal.js on lines 787..797
                                                                                        src/definitions/modules/nag.js on lines 275..285
                                                                                        src/definitions/modules/popup.js on lines 1150..1160
                                                                                        src/definitions/modules/popup.js on lines 1161..1171
                                                                                        src/definitions/modules/progress.js on lines 679..689
                                                                                        src/definitions/modules/rating.js on lines 283..293
                                                                                        src/definitions/modules/search.js on lines 1034..1044
                                                                                        src/definitions/modules/search.js on lines 1045..1055
                                                                                        src/definitions/modules/shape.js on lines 690..700
                                                                                        src/definitions/modules/sidebar.js on lines 783..793
                                                                                        src/definitions/modules/sticky.js on lines 730..740
                                                                                        src/definitions/modules/sticky.js on lines 741..751
                                                                                        src/definitions/modules/tab.js on lines 712..722
                                                                                        src/definitions/modules/transition.js on lines 853..863

                                                                                        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

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

                                                                                                      if(isAdditionWithoutMenu) {
                                                                                                        module.verbose('Selecting item from keyboard shortcut', $selectedItem);
                                                                                                        module.event.item.click.call($selectedItem, event);
                                                                                                        if(module.is.searchSelection()) {
                                                                                                          module.remove.searchTerm();
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1395..1401

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

                                                                                        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

                                                                                                          else if(selectedIsSelectable) {
                                                                                                            module.verbose('Selecting item from keyboard shortcut', $selectedItem);
                                                                                                            module.event.item.click.call($selectedItem, event);
                                                                                                            if(module.is.searchSelection()) {
                                                                                                              module.remove.searchTerm();
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1378..1384

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

                                                                                        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

                                                                                                    if(settings.fireOnInit === false && module.is.initialLoad()) {
                                                                                                      module.verbose('Skipping onadd callback on initial load', settings.onAdd);
                                                                                                    }
                                                                                                    else {
                                                                                                      settings.onAdd.call(element, addedValue, addedText, $selectedItem);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2498..2503
                                                                                        src/definitions/modules/dropdown.js on lines 2939..2944

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  id: function() {
                                                                                                    id = (Math.random().toString(16) + '000000000').substr(2, 8);
                                                                                                    elementNamespace = '.' + id;
                                                                                                    module.verbose('Creating unique id for element', id);
                                                                                                  },
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 3 other locations - About 1 hr to fix
                                                                                        src/definitions/modules/modal.js on lines 133..137
                                                                                        src/definitions/modules/popup.js on lines 302..306
                                                                                        src/definitions/modules/sidebar.js on lines 116..120

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

                                                                                        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

                                                                                                    if(settings.fireOnInit === false && module.is.initialLoad()) {
                                                                                                      module.verbose('No callback on initial load', settings.onChange);
                                                                                                    }
                                                                                                    else {
                                                                                                      settings.onChange.call(element, value, text, $selected);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2786..2791
                                                                                        src/definitions/modules/dropdown.js on lines 2939..2944

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

                                                                                        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

                                                                                                    if(settings.fireOnInit === false && module.is.initialLoad()) {
                                                                                                      module.verbose('No callback on initial load', settings.onRemove);
                                                                                                    }
                                                                                                    else {
                                                                                                      settings.onRemove.call(element, removedValue, removedText, $removedItem);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2498..2503
                                                                                        src/definitions/modules/dropdown.js on lines 2786..2791

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

                                                                                        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

                                                                                                exactSearch: function (query, term) {
                                                                                                  query = query.toLowerCase();
                                                                                                  term  = term.toLowerCase();
                                                                                                  if(term.indexOf(query) > -1) {
                                                                                                     return true;
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/search.js on lines 650..657

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

                                                                                        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
                                                                                                      escapedValue = module.escape.value(value),
                                                                                                      $option      = $input.find('option[value="' + module.escape.string(escapedValue) + '"]'),
                                                                                                      hasOption    = ($option.length > 0)
                                                                                                    ;
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2840..2844

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

                                                                                                settings          = ( $.isPlainObject(parameters) )
                                                                                                  ? $.extend(true, {}, $.fn.dropdown.settings, parameters)
                                                                                                  : $.extend({}, $.fn.dropdown.settings),
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 15 other locations - About 1 hr to fix
                                                                                        src/definitions/behaviors/api.js on lines 44..46
                                                                                        src/definitions/behaviors/visibility.js on lines 42..44
                                                                                        src/definitions/modules/accordion.js on lines 44..46
                                                                                        src/definitions/modules/dimmer.js on lines 39..41
                                                                                        src/definitions/modules/embed.js on lines 42..44
                                                                                        src/definitions/modules/modal.js on lines 50..52
                                                                                        src/definitions/modules/nag.js on lines 38..40
                                                                                        src/definitions/modules/popup.js on lines 44..46
                                                                                        src/definitions/modules/progress.js on lines 49..51
                                                                                        src/definitions/modules/rating.js on lines 38..40
                                                                                        src/definitions/modules/search.js on lines 38..40
                                                                                        src/definitions/modules/shape.js on lines 47..49
                                                                                        src/definitions/modules/sidebar.js on lines 51..53
                                                                                        src/definitions/modules/sticky.js on lines 39..41
                                                                                        src/definitions/modules/tab.js on lines 46..48

                                                                                        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

                                                                                                    var
                                                                                                      escapedValue = module.escape.value(value),
                                                                                                      $option      = $input.find('option[value="' + module.escape.string(escapedValue) + '"]'),
                                                                                                      hasOption    = ($option.length > 0)
                                                                                                    ;
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2659..2663

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

                                                                                        window = (typeof window != 'undefined' && window.Math == Math)
                                                                                          ? window
                                                                                          : (typeof self != 'undefined' && self.Math == Math)
                                                                                            ? self
                                                                                            : Function('return this')()
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 17 other locations - About 1 hr to fix
                                                                                        src/definitions/behaviors/form.js on lines 15..20
                                                                                        src/definitions/behaviors/visibility.js on lines 15..20
                                                                                        src/definitions/modules/accordion.js on lines 15..20
                                                                                        src/definitions/modules/checkbox.js on lines 15..20
                                                                                        src/definitions/modules/dimmer.js on lines 15..20
                                                                                        src/definitions/modules/embed.js on lines 15..20
                                                                                        src/definitions/modules/modal.js on lines 15..20
                                                                                        src/definitions/modules/nag.js on lines 15..20
                                                                                        src/definitions/modules/popup.js on lines 15..20
                                                                                        src/definitions/modules/progress.js on lines 15..20
                                                                                        src/definitions/modules/rating.js on lines 15..20
                                                                                        src/definitions/modules/search.js on lines 15..20
                                                                                        src/definitions/modules/shape.js on lines 15..20
                                                                                        src/definitions/modules/sidebar.js on lines 15..20
                                                                                        src/definitions/modules/sticky.js on lines 15..20
                                                                                        src/definitions/modules/tab.js on lines 15..20
                                                                                        src/definitions/modules/transition.js on lines 15..20

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 62.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                      $module
                                                                                                        .on('click'   + eventNamespace, selector.label,  module.event.label.click)
                                                                                                        .on('click'   + eventNamespace, selector.remove, module.event.remove.click)
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 639..641

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 61.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                    $menu
                                                                                                      .on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
                                                                                                      .on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 582..584

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 61.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  show: function() {
                                                                                                    module.verbose('Delaying show event to ensure user intent');
                                                                                                    clearTimeout(module.timer);
                                                                                                    module.timer = setTimeout(module.show, settings.delay.show);
                                                                                                  },
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3480..3484

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 60.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                $combo = ($module.prev().find(selector.text).length > 0)
                                                                                                  ? $module.prev().find(selector.text)
                                                                                                  : $module.prev(),
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 423..425

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 60.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  hide: function() {
                                                                                                    module.verbose('Delaying hide event to ensure user intent');
                                                                                                    clearTimeout(module.timer);
                                                                                                    module.timer = setTimeout(module.hide, settings.delay.hide);
                                                                                                  }
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3475..3479

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 60.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  $combo  = ($module.prev().find(selector.text).length > 0)
                                                                                                    ? $module.prev().find(selector.text)
                                                                                                    : $module.prev()
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 68..70

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 60.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  horizontallyScrollableContext: function() {
                                                                                                    var
                                                                                                      overflowX = ($context.get(0) !== window)
                                                                                                        ? $context.css('overflow-X')
                                                                                                        : false
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 3 other locations - About 1 hr to fix
                                                                                        src/definitions/behaviors/visibility.js on lines 426..433
                                                                                        src/definitions/behaviors/visibility.js on lines 434..441
                                                                                        src/definitions/modules/dropdown.js on lines 3236..3243

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                  verticallyScrollableContext: function() {
                                                                                                    var
                                                                                                      overflowY = ($context.get(0) !== window)
                                                                                                        ? $context.css('overflow-y')
                                                                                                        : false
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 3 other locations - About 1 hr to fix
                                                                                        src/definitions/behaviors/visibility.js on lines 426..433
                                                                                        src/definitions/behaviors/visibility.js on lines 434..441
                                                                                        src/definitions/modules/dropdown.js on lines 3244..3251

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

                                                                                        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

                                                                                                  defaultText: function() {
                                                                                                    var
                                                                                                      text = module.get.text()
                                                                                                    ;
                                                                                                    module.verbose('Saving default text as', text);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2125..2131

                                                                                        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

                                                                                                  defaultValue: function() {
                                                                                                    var
                                                                                                      value = module.get.value()
                                                                                                    ;
                                                                                                    module.verbose('Saving default value as', value);
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2132..2138

                                                                                        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

                                                                                                  menu: function() {
                                                                                                    if(module.has.menu()) {
                                                                                                      menuObserver.observe($menu[0], {
                                                                                                        childList : true,
                                                                                                        subtree   : true
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 169..176

                                                                                        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

                                                                                                  select: function() {
                                                                                                    if(module.has.input()) {
                                                                                                      selectObserver.observe($module[0], {
                                                                                                        childList : true,
                                                                                                        subtree   : true
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 1 hr to fix
                                                                                        src/definitions/modules/dropdown.js on lines 177..184

                                                                                        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(!event.shiftKey) {
                                                                                                              module.verbose('Selecting previous label');
                                                                                                              $label.removeClass(className.active);
                                                                                                            }
                                                                                                            else {
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 55 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1296..1302

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 54.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                            if(!event.shiftKey) {
                                                                                                              module.verbose('Selecting next label');
                                                                                                              $label.removeClass(className.active);
                                                                                                            }
                                                                                                            else {
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 55 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1270..1276

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 54.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                      if(module.is.multiple() && !module.is.allFiltered()) {
                                                                                                        return;
                                                                                                      }
                                                                                                      else {
                                                                                                        module.hideAndClear();
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 45 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1619..1624

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

                                                                                        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(module.is.multiple() && !module.is.allFiltered()) {
                                                                                                        return;
                                                                                                      }
                                                                                                      else {
                                                                                                        module.hideAndClear();
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 45 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1635..1640

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

                                                                                        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

                                                                                                    $selectedItem = (settings.allowAdditions)
                                                                                                      ? $selectedItem || module.get.itemWithAdditions(value)
                                                                                                      : $selectedItem || module.get.item(value)
                                                                                                    ;
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 40 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2526..2529

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

                                                                                        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

                                                                                                      else if(settings.on == 'hover') {
                                                                                                        $module
                                                                                                          .on('mouseenter' + eventNamespace, module.delay.show)
                                                                                                          .on('mouseleave' + eventNamespace, module.delay.hide)
                                                                                                        ;
                                                                                        Severity: Major
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 40 mins to fix
                                                                                        src/definitions/modules/popup.js on lines 1004..1009
                                                                                        src/definitions/modules/sidebar.js on lines 174..179

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

                                                                                        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

                                                                                                    $selectedItem = (settings.allowAdditions)
                                                                                                      ? $selectedItem || module.get.itemWithAdditions(value)
                                                                                                      : $selectedItem || module.get.item(value)
                                                                                                    ;
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 40 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2877..2880

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

                                                                                        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

                                                                                                refreshData: function() {
                                                                                                  module.verbose('Refreshing cached metadata');
                                                                                                  $item
                                                                                                    .removeData(metadata.text)
                                                                                                    .removeData(metadata.value)
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 40 mins to fix
                                                                                        src/definitions/modules/transition.js on lines 369..375
                                                                                        src/definitions/modules/transition.js on lines 376..382

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 48.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                          error : {
                                                                                            action          : 'You called a dropdown action that was not defined',
                                                                                            alreadySetup    : 'Once a select has been initialized behaviors must be called on the created ui dropdown',
                                                                                            labels          : 'Allowing user additions currently requires the use of labels.',
                                                                                            missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 2 other locations - About 35 mins to fix
                                                                                        src/definitions/modules/modal.js on lines 1024..1033
                                                                                        src/definitions/modules/search.js on lines 1287..1296

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

                                                                                        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( module.is.single() ) {
                                                                                                      $module
                                                                                                        .on('touchstart' + eventNamespace, module.event.test.toggle)
                                                                                                      ;
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 35 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 567..571

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

                                                                                        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( module.is.multiple() ) {
                                                                                                      $document
                                                                                                        .on('keydown' + elementNamespace, module.event.document.keydown)
                                                                                                      ;
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 35 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 548..552

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

                                                                                        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(module.has.message() && !(module.has.maxSelections() || module.has.allResultsFiltered()) ) {
                                                                                                      module.remove.message();
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 30 mins to fix
                                                                                        src/definitions/modules/popup.js on lines 325..343

                                                                                        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

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

                                                                                                    if(module.is.horizontallyScrollableContext()) {
                                                                                                      calculations.menu.offset.left += calculations.context.scrollLeft;
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 30 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3290..3292

                                                                                        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

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

                                                                                                    if(module.is.verticallyScrollableContext()) {
                                                                                                      calculations.menu.offset.top += calculations.context.scrollTop;
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 30 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 3335..3337

                                                                                        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

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

                                                                                                        var
                                                                                                          $selected     = $(this),
                                                                                                          selectedText  = module.get.choiceText($selected),
                                                                                                          selectedValue = module.get.choiceValue($selected, selectedText)
                                                                                                        ;
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 30 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 1944..1948

                                                                                        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

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

                                                                                                          var
                                                                                                            $choice       = $(this),
                                                                                                            optionText    = module.get.choiceText($choice),
                                                                                                            optionValue   = module.get.choiceValue($choice, optionText)
                                                                                                          ;
                                                                                        Severity: Minor
                                                                                        Found in src/definitions/modules/dropdown.js and 1 other location - About 30 mins to fix
                                                                                        src/definitions/modules/dropdown.js on lines 2888..2892

                                                                                        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