medialize/ally.js

View on GitHub

Showing 154 of 736 total issues

Avoid too many return statements within this function.
Open

    return true;
Severity: Major
Found in src/is/focus-relevant.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return true;
    Severity: Major
    Found in src/is/focus-relevant.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return true;
      Severity: Major
      Found in src/is/focus-relevant.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return element.hasAttribute('focusable') || hasTabbableTabindex;
        Severity: Major
        Found in src/is/tabbable.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return hasTabbableTabindex;
          Severity: Major
          Found in src/is/tabbable.js - About 30 mins to fix

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

            export default function({context, skipFocusable} = {}) {
              if (!supports) {
                supports = _supports();
              }
            
            
            Severity: Minor
            Found in src/get/focus-redirect-target.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function({
              context,
              includeContext,
              includeOnlyTabbable,
              strategy,
            Severity: Minor
            Found in src/query/tabsequence.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function({context, callback, area} = {}) {
              if (typeof callback !== 'function') {
                throw new TypeError('when/visible-area requires options.callback to be a function');
              }
            
            
            Severity: Minor
            Found in src/when/visible-area.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function(context, disabledState) {
              if (!supports) {
                supports = _supports();
              }
            
            
            Severity: Minor
            Found in src/element/disabled.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function(node) {
              try {
                // works on <object> and <iframe>
                return node.contentDocument
                  // works on <object> and <iframe>
            Severity: Minor
            Found in src/util/get-content-document.js - About 25 mins 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 getParentComparator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getParentComparator({parent, element, includeSelf} = {}) {
              if (parent) {
                return function isChildOf(node) {
                  return Boolean(
                    includeSelf && node === parent
            Severity: Minor
            Found in src/util/compare-position.js - About 25 mins 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 addGeneratedNotes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function addGeneratedNotes(ident, browser, browserData, data) {
              let element = browserData.elements[ident];
              if (!element) {
                element = {
                  tabindexProperty: 'null',
            Severity: Minor
            Found in build/data-tables/utils/aggregated-focusable-data.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function({
              context,
              label = 'context-to-element',
              resolveDocument,
              defaultToDocument,
            Severity: Minor
            Found in src/util/context-to-element.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
            Open

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

            Severity
            Category
            Status
            Source
            Language