medialize/ally.js

View on GitHub

Showing 154 of 736 total issues

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

module.exports = function plugin(/* options */) {
  return function(files, metalsmith, done) {
    const indexes = {
      documentation: [],
      tutorial: [],
Severity: Minor
Found in build/metalsmith/plugins/write-algolia-index.js - About 1 hr to fix

    Function exports has 39 lines of code (exceeds 25 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 1 hr to fix

      Function generateBrowserStructure has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function generateBrowserStructure(ident, browser, browserData) {
        const element = browserData.elements[ident] || {};
        const scriptFocus = element.scriptFocus || {};
        const ally = element.ally || {};
        const jquery = element.jquery || {};
      Severity: Minor
      Found in build/data-tables/utils/aggregated-focusable-data.js - About 1 hr to fix

        Function readableLabel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function readableLabel(focusable, tabbable, onlyTabbable, redirecting, focusHost) {
          return (redirecting && 'redirecting')
            || (focusable && tabbable && 'tabbable')
            || (focusable && !tabbable && 'focusable')
            || (!focusable && tabbable && 'only tabbable')
        Severity: Minor
        Found in build/data-tables/utils/aggregated-focusable-data.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 plugin has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function plugin(/* options */) {
          return function(files, metalsmith, done) {
            setImmediate(done);
        
            Object.keys(files).forEach(function(key) {
        Severity: Minor
        Found in build/metalsmith/plugins/prepare.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 addReadableLabels has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function addReadableLabels(src) {
          src.browser.label = readableLabel(
            src.browser.focusable,
            src.browser.tabbable,
            null, // onlyTabbable
        Severity: Minor
        Found in build/data-tables/utils/aggregated-focusable-data.js - About 1 hr to fix

          Function addBodyToIssueLink has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function addBodyToIssueLink() {
              var editLink = document.getElementById('document-github-edit');
              var issueLink = document.getElementById('document-github-issue');
          
              if (!issueLink || !editLink) {
          Severity: Minor
          Found in build/metalsmith/assets/website.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

            if (typeof document === 'undefined' || !document.documentElement.createShadowRoot) {
              // no need to initialize any of this if we don't have ShadowDOM available
              engage = disengage = function() {};
            } else {
              let blurTimer;
            Severity: Critical
            Found in src/event/shadow-focus.js - About 1 hr to fix

              Function default has 33 lines of code (exceeds 25 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

                Function verifyLinks has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function verifyLinks(index, filename, $, ignore) {
                  const errors = [];
                
                  $('a').each(function() {
                    const $link = $(this);
                Severity: Minor
                Found in build/metalsmith/plugins/link-checker.js - About 1 hr to fix

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

                  export default function(context) {
                    const element = contextToElement({
                      label: 'element/blur',
                      context,
                    });
                  Severity: Minor
                  Found in src/element/blur.js - About 1 hr to fix

                    Function indexAlgolia has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function indexAlgolia($, data) {
                      if (data.algolia) {
                        return;
                      }
                    
                    
                    Severity: Minor
                    Found in build/metalsmith/plugins/prepare.transform.js - About 1 hr to fix

                      Function addPlatform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function addPlatform(platform, key) {
                        // only to be used for grouping desktop and mobile browsers separately
                        let mobile = false;
                        // "Windows" needs some aliasing, possibly required for other platforms, too
                        const platformFamily = (platform.os.family === 'Windows NT' && 'Windows')
                      Severity: Minor
                      Found in build/data-tables/utils/platforms.js - About 1 hr to fix

                        Function plugin has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function plugin(options) {
                          if (!options) {
                            options = {};
                          }
                        
                        
                        Severity: Minor
                        Found in build/metalsmith/plugins/link-checker.js - About 1 hr to fix

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

                          export default function(context) {
                            if (!supports) {
                              supports = _supports();
                            }
                          
                          
                          Severity: Minor
                          Found in src/is/valid-tabindex.js - About 1 hr to fix

                            Function createShadowRoot has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function createShadowRoot(fixture) {
                                if (!fixture.shadow) {
                                  fixture.shadow = {};
                                }
                            
                            
                            Severity: Minor
                            Found in test/helper/fixtures/shadow-input.fixture.js - About 1 hr to fix

                              Function handleFocusEvent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function handleFocusEvent(event) {
                                let source = '';
                                if (event.type === focusEventName || event.type === 'shadow-focus') {
                                  const interactionType = interactionTypeHandler.get();
                                  source = lock
                              Severity: Minor
                              Found in src/style/focus-source.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 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function(context) {
                                if (!supports) {
                                  supports = _supports();
                                }
                              
                              
                              Severity: Minor
                              Found in src/is/valid-tabindex.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 isVisibleRules has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function isVisibleRules({
                                context,
                                except = {
                                  notRendered: false,
                                  cssDisplay: false,
                              Severity: Minor
                              Found in src/is/visible.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 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function(context) {
                                const element = contextToElement({
                                  label: 'element/blur',
                                  context,
                                });
                              Severity: Minor
                              Found in src/element/blur.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

                              Severity
                              Category
                              Status
                              Source
                              Language