sympmarc/SPServices

View on GitHub
src/value-added/SPScriptAudit.js

Summary

Maintainability
C
1 day
Test Coverage

Function SPScriptAudit has 134 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.SPServices.SPScriptAudit = function (options) {

        var opt = $.extend({}, {
            webURL: "", // [Optional] The name of the Web (site) to audit
            listName: "", // [Optional] The name of a specific list to audit. If not present, all lists in the site are audited.
Severity: Major
Found in src/value-added/SPScriptAudit.js - About 5 hrs to fix

    Function completefunc has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    completefunc: function (xData) {
                        $(xData.responseXML).find("List").each(function () {
                            listXml = $(this);
    
                            // If listName has been specified, then only return results for that list
    Severity: Minor
    Found in src/value-added/SPScriptAudit.js - About 1 hr to fix

      Function SPScriptAuditPage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function SPScriptAuditPage(opt, listXml, pageClass, pageType, pageUrl) {
      
              var jQueryPage = 0;
              var pageScriptSrc = {};
              pageScriptSrc.type = [];
      Severity: Minor
      Found in src/value-added/SPScriptAudit.js - About 1 hr to fix

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

                    success: function (xData) {
        
                        var scriptMatch;
        
                        while (scriptMatch = scriptRegex.exec(xData)) {
        Severity: Minor
        Found in src/value-added/SPScriptAudit.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                                          if ($(this).attr("ID").substring(0, 6) !== "0x0120") {
                                                              var formUrls = $(this).find("FormUrls");
                                                              for (var i = 0; i < formTypes.length; i++) {
                                                                  // Look for a customized form...
                                                                  $(formUrls).find(formTypes[i][0]).each(function () {
          Severity: Major
          Found in src/value-added/SPScriptAudit.js - About 45 mins to fix

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

                function SPScriptAuditPage(opt, listXml, pageClass, pageType, pageUrl) {
            Severity: Minor
            Found in src/value-added/SPScriptAudit.js - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status