medialize/ally.js

View on GitHub
test/unit/is.only-tabbable.test.js

Summary

Maintainability
F
1 wk
Test Coverage

File is.only-tabbable.test.js has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define(function(require) {
  'use strict';

  var bdd = require('intern!bdd');
  var expect = require('intern/chai!expect');
Severity: Minor
Found in test/unit/is.only-tabbable.test.js - About 2 hrs to fix

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

        bdd.describe('for <div> with tabindex attribute', function() {
          bdd.it('should return false for <div>', function() {
            var element = document.getElementById('inert-div');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 4 other locations - About 1 day to fix
    test/unit/is.focus-relevant.test.js on lines 106..131
    test/unit/is.focusable.test.js on lines 106..131
    test/unit/is.only-tabbable.test.js on lines 112..137
    test/unit/is.tabbable.test.js on lines 114..139

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

    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.describe('for <input>', function() {
          bdd.it('should return false for <input>', function() {
            var element = document.getElementById('input');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 4 other locations - About 1 day to fix
    test/unit/is.focus-relevant.test.js on lines 106..131
    test/unit/is.focusable.test.js on lines 106..131
    test/unit/is.only-tabbable.test.js on lines 68..93
    test/unit/is.tabbable.test.js on lines 114..139

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

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.describe('for ShadowDOM', function() {
          var host;
          var root;
    
          bdd.before(function() {
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 2 other locations - About 1 day to fix
    test/unit/is.focus-relevant.test.js on lines 301..327
    test/unit/is.focusable.test.js on lines 337..363

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

    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.describe('for document structure', function() {
          bdd.it('should return false for document', function() {
            expect(isOnlyTabbable(document)).to.equal(false);
          });
    
    
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 5 other locations - About 7 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 44..60
    test/unit/is.focusable.test.js on lines 44..60
    test/unit/is.shadowed.test.js on lines 27..43
    test/unit/is.tabbable.test.js on lines 52..68
    test/unit/is.valid-tabindex.test.js on lines 38..54

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

    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.describe('for scrollable elements', function() {
          bdd.it('should return false for scrollable <div> without CSS overflow property', function() {
            var element = document.getElementById('scroll-container-without-overflow');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 7 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 89..104
    test/unit/is.focusable.test.js on lines 89..104
    test/unit/is.only-tabbable.test.js on lines 95..110

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

    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.describe('for <a>', function() {
          bdd.it('should return false for <a> (without href attribute)', function() {
            var element = document.getElementById('anchor');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 7 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 89..104
    test/unit/is.focusable.test.js on lines 89..104
    test/unit/is.only-tabbable.test.js on lines 268..283

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

    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.describe('for <embed>', function() {
          bdd.before(function() {
            var element = document.getElementById('embed');
            if (!element) {
              this.skip('skipping to avoid test colliding with QuickTime');
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 7 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 243..260
    test/unit/is.focusable.test.js on lines 255..272
    test/unit/is.tabbable.test.js on lines 280..297

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

    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.describe('for CSS Flexbox Layout', function() {
          bdd.before(function() {
            fixture.add([
              /* eslint-disable indent */
              '<div id="flexbox-parent" style="display: -webkit-flex; display: -ms-flexbox; display: flex;">',
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 1 other location - About 6 hrs to fix
    test/unit/is.tabbable.test.js on lines 328..348

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

    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.describe('for <area>', function() {
          bdd.it('should return false for <area>', function() {
            var element = document.getElementById('image-map-area');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 1 other location - About 5 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 164..175

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

    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.describe('for <audio>', function() {
          bdd.it('should return false for <audio controls>', function() {
            var element = document.getElementById('audio-controls');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 4 hrs to fix
    test/unit/is.only-tabbable.test.js on lines 139..149
    test/unit/is.only-tabbable.test.js on lines 237..247
    test/unit/is.visible.test.js on lines 206..216

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 127.

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.describe('for editable elements', function() {
          bdd.it('should return false for <span contenteditable>', function() {
            var element = document.getElementById('span-contenteditable');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 4 hrs to fix
    test/unit/is.only-tabbable.test.js on lines 201..211
    test/unit/is.only-tabbable.test.js on lines 237..247
    test/unit/is.visible.test.js on lines 206..216

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 127.

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.describe('for <object>', function() {
          bdd.it('should return false for <object> referencing an SVG', function() {
            var element = document.getElementById('object-svg');
            expect(isOnlyTabbable(element)).to.equal(false);
          });
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 3 other locations - About 4 hrs to fix
    test/unit/is.only-tabbable.test.js on lines 139..149
    test/unit/is.only-tabbable.test.js on lines 201..211
    test/unit/is.visible.test.js on lines 206..216

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 127.

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

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

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

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

    Refactorings

    Further Reading

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

        bdd.it('should provide .rules() and .except()', function() {
          var element = document.getElementById('inert-div');
          expect(isOnlyTabbable.rules({
            context: element,
          })).to.equal(false, '.rules()');
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 4 other locations - About 3 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 35..42
    test/unit/is.focusable.test.js on lines 35..42
    test/unit/is.tabbable.test.js on lines 43..50
    test/unit/is.visible.test.js on lines 100..107

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

    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 handle invalid input', function() {
          expect(function() {
            isOnlyTabbable(null);
          }).to.throw(TypeError, 'is/only-tabbable requires valid options.context');
    
    
    Severity: Major
    Found in test/unit/is.only-tabbable.test.js and 4 other locations - About 2 hrs to fix
    test/unit/is.focus-relevant.test.js on lines 25..33
    test/unit/is.focusable.test.js on lines 25..33
    test/unit/is.tabbable.test.js on lines 33..41
    test/unit/is.visible.test.js on lines 90..98

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 83.

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

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

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

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

    Refactorings

    Further Reading

    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.only-tabbable.test.js by eslint

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

    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.only-tabbable.test.js by eslint

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

    There are no issues that match your filters.

    Category
    Status