medialize/ally.js

View on GitHub
test/unit/is.disabled.test.js

Summary

Maintainability
D
1 day
Test Coverage

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

      bdd.it('should return true for <form disabled> <input>', function() {
        var element = document.getElementById('disabled-form-input');
        var res = isDisabled(element);
        expect(res).to.equal(!supports.focusFormDisabled);
      });
Severity: Major
Found in test/unit/is.disabled.test.js and 4 other locations - About 1 hr to fix
test/unit/is.disabled.test.js on lines 84..88
test/unit/is.disabled.test.js on lines 104..108
test/unit/is.native-disabled-supported.test.js on lines 52..56
test/unit/is.native-disabled-supported.test.js on lines 58..62

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should return true for <fieldset disabled>', function() {
        var element = document.getElementById('disabled-fieldset');
        var res = isDisabled(element);
        expect(res).to.equal(!supports.focusFieldsetDisabled);
      });
Severity: Major
Found in test/unit/is.disabled.test.js and 4 other locations - About 1 hr to fix
test/unit/is.disabled.test.js on lines 98..102
test/unit/is.disabled.test.js on lines 104..108
test/unit/is.native-disabled-supported.test.js on lines 52..56
test/unit/is.native-disabled-supported.test.js on lines 58..62

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

      bdd.it('should return true for <form disabled>', function() {
        var element = document.getElementById('disabled-form');
        var res = isDisabled(element);
        expect(res).to.equal(!supports.focusFormDisabled);
      });
Severity: Major
Found in test/unit/is.disabled.test.js and 4 other locations - About 1 hr to fix
test/unit/is.disabled.test.js on lines 84..88
test/unit/is.disabled.test.js on lines 98..102
test/unit/is.native-disabled-supported.test.js on lines 52..56
test/unit/is.native-disabled-supported.test.js on lines 58..62

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 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

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

      bdd.it('should return false for <fieldset> <input>', function() {
        var element = document.getElementById('non-disabled-fieldset');
        var res = isDisabled(element);
        expect(res).to.equal(false);
      });
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 64..68
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

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

      bdd.it('should return false for <form> <input>', function() {
        var element = document.getElementById('non-disabled-form');
        var res = isDisabled(element);
        expect(res).to.equal(false);
      });
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 64..68
test/unit/is.disabled.test.js on lines 72..76
test/unit/is.disabled.test.js on lines 78..82
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

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

      bdd.it('should return true for <fieldset disabled> <input>', function() {
        var element = document.getElementById('disabled-fieldset-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 64..68
test/unit/is.disabled.test.js on lines 72..76
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

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

      bdd.it('should return false for <input>', function() {
        var element = document.getElementById('non-disabled-input');
        var res = isDisabled(element);
        expect(res).to.equal(false);
      });
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 64..68
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

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

      bdd.it('should return false for <div>', function() {
        var element = document.getElementById('non-input');
        var res = isDisabled(element);
        expect(res).to.equal(false);
      });
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 58..62
test/unit/is.disabled.test.js on lines 64..68
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

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

    bdd.it('should handle invalid input', function() {
      expect(function() {
        isDisabled(null);
      }).to.throw(TypeError, 'is/disabled requires valid options.context');
    });
Severity: Major
Found in test/unit/is.disabled.test.js and 8 other locations - About 40 mins to fix
test/unit/element.blur.test.js on lines 22..26
test/unit/element.disabled.test.js on lines 111..115
test/unit/element.focus.test.js on lines 24..28
test/unit/is.active-element.test.js on lines 22..26
test/unit/is.native-disabled-supported.test.js on lines 34..38
test/unit/is.shadowed.test.js on lines 21..25
test/unit/is.valid-area.test.js on lines 60..64
test/unit/is.valid-tabindex.test.js on lines 32..36

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

Unexpected '!' in 'intern!bdd'. Do not use import syntax to configure webpack loaders.
Open

  var bdd = require('intern!bdd');
Severity: Minor
Found in test/unit/is.disabled.test.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Unexpected '!' in 'intern/chai!expect'. Do not use import syntax to configure webpack loaders.
Open

  var expect = require('intern/chai!expect');
Severity: Minor
Found in test/unit/is.disabled.test.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status