18F/web-design-standards

View on GitHub
packages/uswds-core/src/js/polyfills/svg4everybody.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function svg4everybody has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function svg4everybody(rawopts) {
    function oninterval() {
      // if all <use>s in the array are being bypassed, don't proceed.
      if (
        numberOfSvgUseElementsToBypass &&
Severity: Major
Found in packages/uswds-core/src/js/polyfills/svg4everybody.js - About 2 hrs to fix

    Function oninterval has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function oninterval() {
          // if all <use>s in the array are being bypassed, don't proceed.
          if (
            numberOfSvgUseElementsToBypass &&
            uses.length - numberOfSvgUseElementsToBypass <= 0
    Severity: Major
    Found in packages/uswds-core/src/js/polyfills/svg4everybody.js - About 2 hrs to fix

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

        function embed(parent, svg, target, use) {
          // if the target exists
          if (target) {
            // create a document fragment to hold the contents of the target
            var fragment = document.createDocumentFragment(),
      Severity: Minor
      Found in packages/uswds-core/src/js/polyfills/svg4everybody.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                      if (url.length) {
                        // get the cached xhr request
                        var xhr = requests[url];
                        // ensure the xhr request exists
                        xhr ||
        Severity: Major
        Found in packages/uswds-core/src/js/polyfills/svg4everybody.js - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status