medialize/ally.js

View on GitHub

Showing 736 of 736 total issues

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

function addReadableLabels(src) {
  src.browser.label = readableLabel(
    src.browser.focusable,
    src.browser.tabbable,
    null, // onlyTabbable
Severity: Minor
Found in build/data-tables/utils/aggregated-focusable-data.js - About 1 hr to fix

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

    requirejs.optimize(config, function(/* buildResponse */) {
      // buildResponse is just a text output of the modules
      // included. Load the built file for the contents.
      // Use config.out to get the optimized file contents.
      // var contents = fs.readFileSync(config.out, 'utf8');
    Severity: Major
    Found in build/web-tests/build.event-sequence.js and 1 other location - About 1 hr to fix
    build/web-tests/build.focusable.js on lines 33..45

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should be visible 75% when parent ist scrolled 75%', function() {
            fixture.outer.scrollLeft = 150;
            expect(fixFloat(visibleArea(fixture.target))).to.equal(0.75);
          });
    Severity: Major
    Found in test/unit/util.visible-area.test.js and 3 other locations - About 1 hr to fix
    test/unit/util.visible-area.test.js on lines 96..99
    test/unit/util.visible-area.test.js on lines 101..104
    test/unit/util.visible-area.test.js on lines 111..114

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should be visible 50% when parent ist scrolled 50%', function() {
            fixture.outer.scrollLeft = 100;
            expect(fixFloat(visibleArea(fixture.target))).to.equal(0.5);
          });
    Severity: Major
    Found in test/unit/util.visible-area.test.js and 3 other locations - About 1 hr to fix
    test/unit/util.visible-area.test.js on lines 96..99
    test/unit/util.visible-area.test.js on lines 106..109
    test/unit/util.visible-area.test.js on lines 111..114

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should be visible 100% when parent ist scrolled 100%', function() {
            fixture.outer.scrollLeft = 200;
            expect(fixFloat(visibleArea(fixture.target))).to.equal(1);
          });
    Severity: Major
    Found in test/unit/util.visible-area.test.js and 3 other locations - About 1 hr to fix
    test/unit/util.visible-area.test.js on lines 96..99
    test/unit/util.visible-area.test.js on lines 101..104
    test/unit/util.visible-area.test.js on lines 106..109

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

    requirejs.optimize(config, function(/* buildResponse */) {
      // buildResponse is just a text output of the modules
      // included. Load the built file for the contents.
      // Use config.out to get the optimized file contents.
      // var contents = fs.readFileSync(config.out, 'utf8');
    Severity: Major
    Found in build/web-tests/build.focusable.js and 1 other location - About 1 hr to fix
    build/web-tests/build.event-sequence.js on lines 41..53

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should be visible 25% when parent ist scrolled 25%', function() {
            fixture.outer.scrollLeft = 50;
            expect(fixFloat(visibleArea(fixture.target))).to.equal(0.25);
          });
    Severity: Major
    Found in test/unit/util.visible-area.test.js and 3 other locations - About 1 hr to fix
    test/unit/util.visible-area.test.js on lines 101..104
    test/unit/util.visible-area.test.js on lines 106..109
    test/unit/util.visible-area.test.js on lines 111..114

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        mouse: function(target, type, options) {
          var event = createMouseEvent(type, options || {});
          if (!event) {
            return event;
          }
    Severity: Major
    Found in test/helper/dispatch-event.js and 1 other location - About 1 hr to fix
    test/helper/dispatch-event.js on lines 89..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should return {browser-specific} for tabindex="" (empty)', function() {
            var element = document.getElementById('tabindex-empty');
            // .tabIndex IE: 0, rest: -1
            expect(isValidTabindex(element)).to.equal(supports.focusInvalidTabindex);
          });
    Severity: Major
    Found in test/unit/is.valid-tabindex.test.js and 1 other location - About 1 hr to fix
    test/unit/is.valid-tabindex.test.js on lines 95..99

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

      $('h3').each(function() {
        const $headline = $(this);
        if ($headline.next().is('h2, h3')) {
          $headline.remove();
        }
    Severity: Major
    Found in build/metalsmith/plugins/prepare.transform.js and 1 other location - About 1 hr to fix
    build/metalsmith/plugins/prepare.transform.js on lines 81..86

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.before(function() {
            frame = new TestFrame([
              /* eslint-disable indent */
              '<!DOCTYPE html>',
              '<html lang="en">',
    Severity: Major
    Found in test/unit/util.get-frame-element.test.js and 1 other location - About 1 hr to fix
    test/unit/util.get-content-document.test.js on lines 15..32

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.beforeEach(function() {
          var deferred = this.async(10000);
          fixture = focusableFixture();
          mutateFixtureForImageMaps();
          // NOTE: Firefox decodes DataURIs asynchronously
    Severity: Major
    Found in test/unit/query.tabsequence.sort-area.test.js and 1 other location - About 1 hr to fix
    test/unit/query.tabsequence.test.js on lines 80..86

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.it('should return {browser-specific} for tabindex="bad"', function() {
            var element = document.getElementById('tabindex-bad');
            // .tabIndex IE: 0, rest: -1
            expect(isValidTabindex(element)).to.equal(supports.focusInvalidTabindex);
          });
    Severity: Major
    Found in test/unit/is.valid-tabindex.test.js and 1 other location - About 1 hr to fix
    test/unit/is.valid-tabindex.test.js on lines 101..105

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        key: function(target, type, options) {
          var event = createKeyEvent(type, options || {});
          if (!event) {
            return event;
          }
    Severity: Major
    Found in test/helper/dispatch-event.js and 1 other location - About 1 hr to fix
    test/helper/dispatch-event.js on lines 76..87

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.beforeEach(function() {
          var deferred = this.async(10000);
          fixture = focusableFixture();
          mutateFixtureForImageMaps();
          // NOTE: Firefox decodes DataURIs asynchronously
    Severity: Major
    Found in test/unit/query.tabsequence.test.js and 1 other location - About 1 hr to fix
    test/unit/query.tabsequence.sort-area.test.js on lines 28..34

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

          bdd.before(function() {
            frame = new TestFrame([
              /* eslint-disable indent */
              '<!DOCTYPE html>',
              '<html lang="en">',
    Severity: Major
    Found in test/unit/util.get-content-document.test.js and 1 other location - About 1 hr to fix
    test/unit/util.get-frame-element.test.js on lines 20..37

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

      $('h2').each(function() {
        const $headline = $(this);
        if ($headline.next().is('h2')) {
          $headline.remove();
        }
    Severity: Major
    Found in build/metalsmith/plugins/prepare.transform.js and 1 other location - About 1 hr to fix
    build/metalsmith/plugins/prepare.transform.js on lines 88..93

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

      function addBodyToIssueLink() {
        var editLink = document.getElementById('document-github-edit');
        var issueLink = document.getElementById('document-github-issue');
    
        if (!issueLink || !editLink) {
    Severity: Minor
    Found in build/metalsmith/assets/website.js - About 1 hr to fix

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

          bdd.it('should ignore non-focusable scrolling containers', function() {
            var element = document.getElementById('div-section-overflow-scroll-body');
            var result = elementFocus(element);
            expect(result).to.equal(null);
          });
      Severity: Major
      Found in test/unit/element.focus.test.js and 4 other locations - About 1 hr to fix
      test/unit/element.blur.test.js on lines 28..32
      test/unit/element.focus.test.js on lines 30..34
      test/unit/element.focus.test.js on lines 68..72
      test/unit/util.tabindex-value.test.js on lines 34..38

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

            bdd.it('should return true for <input disabled>', function() {
              var element = document.getElementById('disabled-input');
              var res = isDisabled(element);
              expect(res).to.equal(true);
            });
      Severity: Major
      Found in test/unit/is.disabled.test.js and 7 other locations - About 1 hr to fix
      test/unit/is.disabled.test.js on lines 45..49
      test/unit/is.disabled.test.js on lines 58..62
      test/unit/is.disabled.test.js on lines 72..76
      test/unit/is.disabled.test.js on lines 78..82
      test/unit/is.disabled.test.js on lines 92..96
      test/unit/is.native-disabled-supported.test.js on lines 40..44
      test/unit/is.native-disabled-supported.test.js on lines 46..50

      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

      Severity
      Category
      Status
      Source
      Language