Semantic-Org/Semantic-UI

View on GitHub
src/definitions/behaviors/form.js

Summary

Maintainability
F
3 wks
Test Coverage

Function form has 1120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.form = function(parameters) {
  var
    $allModules      = $(this),
    moduleSelector   = $allModules.selector || '',

Severity: Major
Found in src/definitions/behaviors/form.js - About 5 days to fix

    File form.js has 1544 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * # Semantic UI - Form Validation
     * http://github.com/semantic-org/semantic-ui/
     *
     *
    Severity: Major
    Found in src/definitions/behaviors/form.js - About 4 days to fix

      Function creditCard has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          creditCard: function(cardNumber, cardTypes) {
            var
              cards = {
                visa: {
                  pattern : /^4/,
      Severity: Major
      Found in src/definitions/behaviors/form.js - About 3 hrs to fix

        Function values has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  values: function (fields) {
                    var
                      $fields = $.isArray(fields)
                        ? module.get.fields(fields)
                        : $field,
        Severity: Major
        Found in src/definitions/behaviors/form.js - About 2 hrs to fix

          Function field has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    field: function(field, fieldName, showErrors) {
                      showErrors = (showErrors !== undefined)
                        ? showErrors
                        : true
                      ;
          Severity: Major
          Found in src/definitions/behaviors/form.js - About 2 hrs to fix

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

                      values: function (fields) {
                        if($.isEmptyObject(fields)) {
                          return;
                        }
                        $.each(fields, function(key, value) {
            Severity: Major
            Found in src/definitions/behaviors/form.js - About 2 hrs to fix

              Function invoke has 51 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/behaviors/form.js - About 2 hrs to fix

                Function prompt has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          prompt: function(identifier, errors) {
                            var
                              $field       = module.get.field(identifier),
                              $fieldGroup  = $field.closest($group),
                              $prompt      = $fieldGroup.children(selector.prompt),
                Severity: Minor
                Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                            settings: function() {
                              if($.isPlainObject(parameters)) {
                                var
                                  keys     = Object.keys(parameters),
                                  isLegacySettings = (keys.length > 0)
                  Severity: Minor
                  Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                            reset: function() {
                              $field
                                .each(function () {
                                  var
                                    $field       = $(this),
                    Severity: Minor
                    Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                                prompt: function(rule, field) {
                                  var
                                    ruleName      = module.get.ruleName(rule),
                                    ancillary     = module.get.ancillaryValue(rule),
                                    $field        = module.get.field(field.identifier),
                      Severity: Minor
                      Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                                clear: function() {
                                  $field
                                    .each(function () {
                                      var
                                        $field       = $(this),
                        Severity: Minor
                        Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

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

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

                                      form: function(event, ignoreCallbacks) {
                                        var
                                          values = module.get.values(),
                                          apiRequest
                                        ;
                            Severity: Minor
                            Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                                          keydown: function(event) {
                                            var
                                              $field       = $(this),
                                              key          = event.which,
                                              isInput      = $field.is(selector.input),
                              Severity: Minor
                              Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                                    integer: function(value, range) {
                                      var
                                        intRegExp = $.fn.form.settings.regExp.integer,
                                        min,
                                        max,
                                Severity: Minor
                                Found in src/definitions/behaviors/form.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if(isChecked) {
                                                        values[name] = value || true;
                                                      }
                                                      else {
                                                        values[name] = false;
                                  Severity: Major
                                  Found in src/definitions/behaviors/form.js - About 45 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return $('<input/>');
                                    Severity: Major
                                    Found in src/definitions/behaviors/form.js - About 30 mins to fix

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

                                              performance: {
                                                log: function(message) {
                                                  var
                                                    currentTime,
                                                    executionTime,
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 6 other locations - About 2 days to fix
                                      src/definitions/modules/dimmer.js on lines 526..579
                                      src/definitions/modules/embed.js on lines 447..500
                                      src/definitions/modules/rating.js on lines 322..375
                                      src/definitions/modules/search.js on lines 1084..1137
                                      src/definitions/modules/shape.js on lines 729..782
                                      src/definitions/modules/transition.js on lines 892..945

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

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

                                              invoke: function(query, passedArguments, context) {
                                                var
                                                  object = instance,
                                                  maxDepth,
                                                  found,
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 6 other locations - About 2 days to fix
                                      src/definitions/modules/modal.js on lines 877..929
                                      src/definitions/modules/popup.js on lines 1251..1303
                                      src/definitions/modules/rating.js on lines 376..428
                                      src/definitions/modules/search.js on lines 1138..1190
                                      src/definitions/modules/shape.js on lines 783..835
                                      src/definitions/modules/sticky.js on lines 831..883

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

                                      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( $('[data-validate="'+ identifier +'"]').length > 0 ) {
                                              matchingValue = $('[data-validate="'+ identifier +'"]').val();
                                            }
                                            else if($('#' + identifier).length > 0) {
                                              matchingValue = $('#' + identifier).val();
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 day to fix
                                      src/definitions/behaviors/form.js on lines 1548..1559

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

                                      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( $('[data-validate="'+ identifier +'"]').length > 0 ) {
                                              matchingValue = $('[data-validate="'+ identifier +'"]').val();
                                            }
                                            else if($('#' + identifier).length > 0) {
                                              matchingValue = $('#' + identifier).val();
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 day to fix
                                      src/definitions/behaviors/form.js on lines 1523..1534

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

                                      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/behaviors/form.js and 18 other locations - About 4 hrs to fix
                                      src/definitions/behaviors/api.js on lines 882..892
                                      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/dropdown.js on lines 3553..3563
                                      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

                                      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/behaviors/form.js and 18 other locations - About 4 hrs to fix
                                      src/definitions/behaviors/api.js on lines 871..881
                                      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/dropdown.js on lines 3542..3552
                                      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

                                      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/behaviors/form.js and 18 other locations - About 2 hrs to fix
                                      src/definitions/behaviors/api.js on lines 893..898
                                      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/dropdown.js on lines 3564..3569
                                      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 25 locations. Consider refactoring.
                                      Open

                                              setting: function(name, value) {
                                                if( $.isPlainObject(name) ) {
                                                  $.extend(true, settings, name);
                                                }
                                                else if(value !== undefined) {
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.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 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/dropdown.js on lines 3531..3541
                                      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

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

                                          contains: function(value, text) {
                                            // escape regex characters
                                            text = text.replace($.fn.form.settings.regExp.escape, "\\$&");
                                            return (value.search( new RegExp(text, 'i') ) !== -1);
                                          },
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1472..1476

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 74.

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 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/behaviors/form.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/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/dropdown.js on lines 3531..3541
                                      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

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

                                          doesntContain: function(value, text) {
                                            // escape regex characters
                                            text = text.replace($.fn.form.settings.regExp.escape, "\\$&");
                                            return (value.search( new RegExp(text, 'i') ) === -1);
                                          },
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1458..1462

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 74.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                          containsExactly: function(value, text) {
                                            // escape regex characters
                                            text = text.replace($.fn.form.settings.regExp.escape, "\\$&");
                                            return (value.search( new RegExp(text) ) !== -1);
                                          },
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1479..1483

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

                                      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

                                          doesntContainExactly: function(value, text) {
                                            // escape regex characters
                                            text = text.replace($.fn.form.settings.regExp.escape, "\\$&");
                                            return (value.search( new RegExp(text) ) === -1);
                                          },
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1465..1469

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

                                      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

                                          is: function(value, text) {
                                            text = (typeof text == 'string')
                                              ? text.toLowerCase()
                                              : text
                                            ;
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1440..1450

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

                                      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

                                          not: function(value, notValue) {
                                            value = (typeof value == 'string')
                                              ? value.toLowerCase()
                                              : value
                                            ;
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 1422..1432

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

                                      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/behaviors/form.js and 17 other locations - About 1 hr to fix
                                      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/dropdown.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

                                                      else if(isCheckbox) {
                                                        module.verbose('Setting checkbox value', value, $element);
                                                        if(value === true) {
                                                          $element.checkbox('check');
                                                        }
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 221..232

                                      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

                                                    if(isDropdown) {
                                                      module.verbose('Resetting dropdown value', $element, defaultValue);
                                                      $element.dropdown('restore defaults');
                                                    }
                                                    else if(isCheckbox) {
                                      Severity: Major
                                      Found in src/definitions/behaviors/form.js and 1 other location - About 1 hr to fix
                                      src/definitions/behaviors/form.js on lines 891..907

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status