hugoruscitti/pilas

View on GitHub
data/manual/mkdocs/js/text.js

Summary

Maintainability
C
1 day
Test Coverage

File text.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */
Severity: Minor
Found in data/manual/mkdocs/js/text.js - About 2 hrs to fix

    Function get has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            text.get = function (url, callback, errback, headers) {
                var xhr = text.createXhr(), header;
                xhr.open('GET', url, true);
    
                //Allow plugins direct access to xhr headers
    Severity: Minor
    Found in data/manual/mkdocs/js/text.js - About 1 hr to fix

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

              load: function (name, req, onLoad, config) {
                  //Name has format: some.module.filext!strip
                  //The strip part is optional.
                  //if strip is present, then that means only get the string contents
                  //inside a body tag in an HTML string. For XML/SVG content it means
      Severity: Minor
      Found in data/manual/mkdocs/js/text.js - About 1 hr to fix

        Function parseName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                parseName: function (name) {
                    var modName, ext, temp,
                        strip = false,
                        index = name.indexOf("."),
                        isRelative = name.indexOf('./') === 0 ||
        Severity: Minor
        Found in data/manual/mkdocs/js/text.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
                      typeof Components !== 'undefined' && Components.classes &&
                      Components.interfaces)) {
                  //Avert your gaze!
                  Cc = Components.classes;
          Severity: Major
          Found in data/manual/mkdocs/js/text.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (errback) {
                                        errback(err);
                                    }
            Severity: Major
            Found in data/manual/mkdocs/js/text.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (headers.hasOwnProperty(header)) {
                                      xhr.setRequestHeader(header.toLowerCase(), headers[header]);
                                  }
              Severity: Major
              Found in data/manual/mkdocs/js/text.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (xpcIsWindows) {
                                url = url.replace(/\//g, '\\');
                            }
                Severity: Major
                Found in data/manual/mkdocs/js/text.js - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (masterConfig.env === 'node' || (!masterConfig.env &&
                              typeof process !== "undefined" &&
                              process.versions &&
                              !!process.versions.node &&
                              !process.versions['node-webkit'])) {
                  Severity: Major
                  Found in data/manual/mkdocs/js/text.js - About 40 mins to fix

                    Function writeFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            writeFile: function (pluginName, moduleName, req, write, config) {
                    Severity: Minor
                    Found in data/manual/mkdocs/js/text.js - About 35 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status