medialize/ally.js

View on GitHub

Showing 736 of 736 total issues

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

      bdd.it('should be visible 75% when element ist translated 125%', function() {
        fixture.outer.scrollLeft = 0;
        transform(fixture.inner, 'translate(-250px, 0px)');
        expect(fixFloat(visibleArea(fixture.target))).to.equal(0.75);
      });
Severity: Major
Found in test/unit/util.visible-area.test.js and 5 other locations - About 2 hrs to fix
test/unit/util.visible-area.test.js on lines 130..134
test/unit/util.visible-area.test.js on lines 136..140
test/unit/util.visible-area.test.js on lines 142..146
test/unit/util.visible-area.test.js on lines 148..152
test/unit/util.visible-area.test.js on lines 154..158

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should be visible 0% when element ist translated 0%', function() {
        fixture.outer.scrollLeft = 0;
        transform(fixture.inner, 'translate(0px, 0px)');
        expect(fixFloat(visibleArea(fixture.target))).to.equal(0);
      });
Severity: Major
Found in test/unit/util.visible-area.test.js and 5 other locations - About 2 hrs to fix
test/unit/util.visible-area.test.js on lines 136..140
test/unit/util.visible-area.test.js on lines 142..146
test/unit/util.visible-area.test.js on lines 148..152
test/unit/util.visible-area.test.js on lines 154..158
test/unit/util.visible-area.test.js on lines 160..164

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

        bdd.it('should remove class', function() {
          var div = document.createElement('div');
          div.className = 'test';
          toggleClass(div, 'test', false);
          expect(div.className).to.equal('');
Severity: Major
Found in test/unit/util.toggle-class.test.js and 1 other location - About 2 hrs to fix
test/unit/util.toggle-class.test.js on lines 41..46

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should be visible 75% when element ist translated 75%', function() {
        fixture.outer.scrollLeft = 0;
        transform(fixture.inner, 'translate(-150px, 0px)');
        expect(fixFloat(visibleArea(fixture.target))).to.equal(0.75);
      });
Severity: Major
Found in test/unit/util.visible-area.test.js and 5 other locations - About 2 hrs to fix
test/unit/util.visible-area.test.js on lines 130..134
test/unit/util.visible-area.test.js on lines 136..140
test/unit/util.visible-area.test.js on lines 142..146
test/unit/util.visible-area.test.js on lines 154..158
test/unit/util.visible-area.test.js on lines 160..164

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should be visible 25% when element ist translated 25%', function() {
        fixture.outer.scrollLeft = 0;
        transform(fixture.inner, 'translate(-50px, 0px)');
        expect(fixFloat(visibleArea(fixture.target))).to.equal(0.25);
      });
Severity: Major
Found in test/unit/util.visible-area.test.js and 5 other locations - About 2 hrs to fix
test/unit/util.visible-area.test.js on lines 130..134
test/unit/util.visible-area.test.js on lines 142..146
test/unit/util.visible-area.test.js on lines 148..152
test/unit/util.visible-area.test.js on lines 154..158
test/unit/util.visible-area.test.js on lines 160..164

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

        bdd.it('should not duplicate existing class', function() {
          var div = document.createElement('div');
          div.className = 'test';
          toggleClass(div, 'test', true);
          expect(div.className).to.equal('test');
Severity: Major
Found in test/unit/util.toggle-class.test.js and 1 other location - About 2 hrs to fix
test/unit/util.toggle-class.test.js on lines 26..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should be visible 100% when element ist translated 100%', function() {
        fixture.outer.scrollLeft = 0;
        transform(fixture.inner, 'translate(-200px, 0px)');
        expect(fixFloat(visibleArea(fixture.target))).to.equal(1);
      });
Severity: Major
Found in test/unit/util.visible-area.test.js and 5 other locations - About 2 hrs to fix
test/unit/util.visible-area.test.js on lines 130..134
test/unit/util.visible-area.test.js on lines 136..140
test/unit/util.visible-area.test.js on lines 142..146
test/unit/util.visible-area.test.js on lines 148..152
test/unit/util.visible-area.test.js on lines 160..164

Duplicated Code

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

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

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

Tuning

This issue has a mass of 75.

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

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

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

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

Refactorings

Further Reading

Function default has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export default function(map = {}) {
  const bindings = {};

  const context = nodeArray(map.context)[0] || document.documentElement;
  delete map.context;
Severity: Minor
Found in src/when/key.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

      bdd.it('should resolve the element hosting the contentDocument from cache', function() {
        var objectDocument = object.contentDocument;
        var element = objectDocument.querySelector('a');

        var cachedFrameElement = getFrameElement(element);
Severity: Major
Found in test/unit/util.get-frame-element.test.js and 3 other locations - About 1 hr to fix
test/unit/util.get-frame-element.test.js on lines 80..86
test/unit/util.get-frame-element.test.js on lines 130..136
test/unit/util.get-frame-element.test.js on lines 138..144

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

      bdd.it('should resolve the element hosting the contentDocument from cache', function() {
        var objectDocument = object.contentDocument;
        var element = objectDocument.querySelector('a');

        var cachedFrameElement = getFrameElement(element);
Severity: Major
Found in test/unit/util.get-frame-element.test.js and 3 other locations - About 1 hr to fix
test/unit/util.get-frame-element.test.js on lines 80..86
test/unit/util.get-frame-element.test.js on lines 88..94
test/unit/util.get-frame-element.test.js on lines 130..136

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

      bdd.it('should resolve the element hosting the contentDocument', function() {
        var objectDocument = object.contentDocument;
        var element = objectDocument.querySelector('a');

        var frameElement = getFrameElement(element);
Severity: Major
Found in test/unit/util.get-frame-element.test.js and 3 other locations - About 1 hr to fix
test/unit/util.get-frame-element.test.js on lines 88..94
test/unit/util.get-frame-element.test.js on lines 130..136
test/unit/util.get-frame-element.test.js on lines 138..144

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

      bdd.it('should resolve the element hosting the contentDocument', function() {
        var objectDocument = object.contentDocument;
        var element = objectDocument.querySelector('a');

        var frameElement = getFrameElement(element);
Severity: Major
Found in test/unit/util.get-frame-element.test.js and 3 other locations - About 1 hr to fix
test/unit/util.get-frame-element.test.js on lines 80..86
test/unit/util.get-frame-element.test.js on lines 88..94
test/unit/util.get-frame-element.test.js on lines 138..144

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

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

function sorter(order) {
  order = order || [];

  return function(one, two) {
    let a = one.sidebar || one.title;
Severity: Minor
Found in build/metalsmith/plugins/collection.manual-sort.js - About 1 hr to fix

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

          bdd.it('should return {browser-specific} for <label tabindex="-1">', function() {
            var element = document.getElementById('label');
            element.setAttribute('tabindex', '-1');
            expect(isFocusable(element)).to.equal(supports.focusLabelTabindex);
          });
    Severity: Major
    Found in test/unit/is.focusable.test.js and 4 other locations - About 1 hr to fix
    test/unit/is.focusable.test.js on lines 152..156
    test/unit/is.focusable.test.js on lines 170..174
    test/unit/is.focusable.test.js on lines 189..193
    test/unit/is.tabbable.test.js on lines 214..218

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

    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

    isOnlyTabbableRules.except = function(except = {}) {
      const isOnlyTabbable = function(context) {
        return isOnlyTabbableRules({
          context,
          except,
    Severity: Major
    Found in src/is/only-tabbable.js and 3 other locations - About 1 hr to fix
    src/is/focus-relevant.js on lines 248..258
    src/is/focusable.js on lines 157..167
    src/is/visible.js on lines 123..133

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

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

          bdd.it('should return {browser-specific} for <area tabindex="-1">', function() {
            var element = document.getElementById('image-map-area');
            element.setAttribute('tabindex', '-1');
            expect(isFocusable(element)).to.equal(supports.focusAreaTabindex);
          });
    Severity: Major
    Found in test/unit/is.focusable.test.js and 4 other locations - About 1 hr to fix
    test/unit/is.focusable.test.js on lines 152..156
    test/unit/is.focusable.test.js on lines 183..187
    test/unit/is.focusable.test.js on lines 189..193
    test/unit/is.tabbable.test.js on lines 214..218

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

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

          bdd.it('should return {browser-specific} for <label tabindex="0">', function() {
            var element = document.getElementById('label');
            element.setAttribute('tabindex', '0');
            expect(isFocusableAndTabbable(element)).to.equal(supports.focusLabelTabindex);
          });
    Severity: Major
    Found in test/unit/is.tabbable.test.js and 4 other locations - About 1 hr to fix
    test/unit/is.focusable.test.js on lines 152..156
    test/unit/is.focusable.test.js on lines 170..174
    test/unit/is.focusable.test.js on lines 183..187
    test/unit/is.focusable.test.js on lines 189..193

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

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

          bdd.it('should return {browser-specific} for <label tabindex="0">', function() {
            var element = document.getElementById('label');
            element.setAttribute('tabindex', '0');
            expect(isFocusable(element)).to.equal(supports.focusLabelTabindex);
          });
    Severity: Major
    Found in test/unit/is.focusable.test.js and 4 other locations - About 1 hr to fix
    test/unit/is.focusable.test.js on lines 152..156
    test/unit/is.focusable.test.js on lines 170..174
    test/unit/is.focusable.test.js on lines 183..187
    test/unit/is.tabbable.test.js on lines 214..218

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

    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

    isFocusRelevantRules.except = function(except = {}) {
      const isFocusRelevant = function(context) {
        return isFocusRelevantRules({
          context,
          except,
    Severity: Major
    Found in src/is/focus-relevant.js and 3 other locations - About 1 hr to fix
    src/is/focusable.js on lines 157..167
    src/is/only-tabbable.js on lines 60..70
    src/is/visible.js on lines 123..133

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

    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

    isVisibleRules.except = function(except = {}) {
      const isVisible = function(context) {
        return isVisibleRules({
          context,
          except,
    Severity: Major
    Found in src/is/visible.js and 3 other locations - About 1 hr to fix
    src/is/focus-relevant.js on lines 248..258
    src/is/focusable.js on lines 157..167
    src/is/only-tabbable.js on lines 60..70

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 71.

    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