medialize/ally.js

View on GitHub

Showing 154 of 736 total issues

Function isTabbableRules has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
Open

function isTabbableRules({
  context,
  except = {
    flexbox: false,
    scrollable: false,
Severity: Minor
Found in src/is/tabbable.js - About 2 days 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

Function isFocusRelevantRules has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
Open

function isFocusRelevantRules({
  context,
  except = {
    flexbox: false,
    scrollable: false,
Severity: Minor
Found in src/is/focus-relevant.js - About 1 day 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

File when.key.test.js has 452 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/when.key.test.js - About 6 hrs to fix

    File is.tabbable.test.js has 311 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.tabbable.test.js - About 3 hrs to fix

      Function isFocusableRules has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      function isFocusableRules({
        context,
        except = {
          disabled: false,
          visible: false,
      Severity: Minor
      Found in src/is/focusable.js - About 3 hrs 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

      File is.focusable.test.js has 297 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.focusable.test.js - About 3 hrs to fix

        Function exports has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function(md/*, options */) {
          md.core.ruler.push('container_example', function(state) {
            const tokens = state.tokens;
            let containerOpen;
            let headingContent;
        Severity: Minor
        Found in build/metalsmith/markdown/markdown-container-example.js - About 2 hrs 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

        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

          Notes has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Notes {
            constructor(source, offset) {
              // the source data
              this.source = source;
              // the result data
          Severity: Minor
          Found in build/data-tables/utils/focusable.notes.interface.js - About 2 hrs to fix

            Function isOnlyTabbableRules has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            function isOnlyTabbableRules({
              context,
              except = {
                onlyFocusableBrowsingContext: false,
                visible: false,
            Severity: Minor
            Found in src/is/only-tabbable.js - About 2 hrs 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

            File is.focus-relevant.test.js has 267 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.focus-relevant.test.js - About 2 hrs to fix

              Function queryFocusableStrict has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function queryFocusableStrict({
                context,
                includeContext,
                includeOnlyTabbable,
                strategy,
              Severity: Minor
              Found in src/query/focusable.strict.js - About 2 hrs 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

              Function default has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function(map = {}) {
                const bindings = {};
              
                const context = nodeArray(map.context)[0] || document.documentElement;
                delete map.context;
              Severity: Major
              Found in src/when/key.js - About 2 hrs to fix

                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

                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

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

                  export default function({ context } = {}) {
                    if (!context) {
                      context = document.documentElement;
                    }
                  
                  
                  Severity: Minor
                  Found in src/maintain/tab-focus.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

                  Function isOnlyFocusRelevant has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function isOnlyFocusRelevant(element) {
                    const nodeName = element.nodeName.toLowerCase();
                    if (nodeName === 'embed' || nodeName === 'keygen') {
                      // embed is considered focus-relevant but not focusable
                      // see https://github.com/medialize/ally.js/issues/82
                  Severity: Minor
                  Found in src/is/focusable.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

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

                  export default function(context) {
                    if (!supports) {
                      supports = _supports();
                    }
                  
                  
                  Severity: Minor
                  Found in src/is/valid-area.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

                  Function createShadowDomStructure has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var createShadowDomStructure = function(element) {
                        var input = {};
                        var root = {};
                  
                        var firstShadowRoot = element.createShadowRoot();
                  Severity: Minor
                  Found in test/unit/query.tabsequence.test.js - About 1 hr to fix

                    Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(md, options) {
                      if (!options || !options.pattern || !options.url) {
                        throw new Error('the options "pattern" and "url" are required!');
                      }
                    
                    
                    Severity: Minor
                    Found in build/metalsmith/markdown/markdown-link-code.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language