sympmarc/SPServices

View on GitHub

Showing 43 of 105 total issues

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

            completefunc: function (xData) {

                // Handle errors
                $(xData.responseXML).find("errorstring").each(function () {
                    var errorText = $(this).text();
Severity: Major
Found in src/value-added/SPDisplayRelatedInfo.js - About 2 hrs to fix

    Function SPGetCurrentUser has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.SPServices.SPGetCurrentUser = function (options) {
    
            var opt = $.extend({}, {
                webURL: "", // URL of the target Site Collection.  If not specified, the current Web is used.
                fieldName: "Name", // Specifies which field to return from the userdisp.aspx page
    Severity: Major
    Found in src/utils/SPGetCurrentUser.js - About 2 hrs to fix

      Function SPUpdateMultipleListItems has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.SPServices.SPUpdateMultipleListItems = function (options) {
      
              var opt = $.extend({}, {
                  webURL: "", // [Optional] URL of the target Web.  If not specified, the current Web is used.
                  listName: "", // The list to operate on.
      Severity: Major
      Found in src/value-added/SPUpdateMultipleListItems.js - About 2 hrs to fix

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

            $.fn.SPServices.SPArrangeChoices = function (options) {
        
                var opt = $.extend({}, {
                    listName: $().SPServices.SPListNameFromUrl(), // The list name for the current form
                    columnName: "", // The display name of the column in the form
        Severity: Major
        Found in src/value-added/SPArrangeChoices.js - About 2 hrs to fix

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

              $.fn.SPServices.SPSetMultiSelectSizes = function (options) {
          
                  var opt = $.extend({}, {
                      listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context.
                      multiSelectColumn: "",
          Severity: Minor
          Found in src/value-added/SPSetMultiSelectSizes.js - About 1 hr 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 SPRedirectWithID has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.SPServices.SPRedirectWithID = function (options) {
              
                      var opt = $.extend({}, {
                          redirectUrl: "", // Page for the redirect
                          qsParamName: "ID" // In some cases, you may want to pass the newly created item's ID with a different
              Severity: Minor
              Found in src/value-added/SPRedirectWithID.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 SPGetLastItemId has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.fn.SPServices.SPGetLastItemId = function (options) {
                  
                          var opt = $.extend({}, {
                              webURL: "", // URL of the target Web.  If not specified, the current Web is used.
                              listName: "", // The name or GUID of the list
                  Severity: Minor
                  Found in src/utils/SPGetLastItemId.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function(current, target, breadcrumbs) {
                    
                      var className = '';
                    
                      if (!current || !target){
                    Severity: Minor
                    Found in docs/layouts/helpers/is_active_with_ancestor.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 SPDropdownCtl has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        $.fn.SPServices.SPDropdownCtl = function (options) {
                    
                            var opt = $.extend({}, {
                                displayName: "" // The displayName of the column on the form
                            }, options);
                    Severity: Minor
                    Found in src/utils/SPDropdownCtl.js - About 1 hr to fix

                      Function SPDebugXMLHttpResult has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.SPServices.SPDebugXMLHttpResult = function (options) {
                      
                              var opt = $.extend({}, {
                                  node: null, // An XMLHttpResult object from an ajax call
                                  indent: 0 // Number of indents
                      Severity: Minor
                      Found in src/utils/SPDebugXMLHttpResult.js - About 1 hr to fix

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

                            $.fn.SPServices.SPComplexToSimpleDropdown = function (options) {
                        
                                var opt = $.extend({}, {
                                    listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context.
                                    columnName: "", // The display name of the column in the form
                        Severity: Minor
                        Found in src/value-added/SPComplexToSimpleDropdown.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

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

                                    getDropdownSelected: function (columnSelect, matchOnId) {
                            
                                        var columnSelectSelected = [];
                            
                                        switch (columnSelect.Type) {
                            Severity: Minor
                            Found in src/core/SPServices.utils.js - About 1 hr to fix

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

                                  $.fn.SPXmlToJson = function (options) {
                              
                                      var opt = $.extend({}, {
                                          mapping: {}, // columnName: mappedName: "mappedName", objectType: "objectType"
                                          includeAllAttrs: false, // If true, return all attributes, regardless whether they are in the mapping
                              Severity: Minor
                              Found in src/utils/SPXmlToJson.js - About 1 hr to fix

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

                                    $.fn.SPServices.SPListNameFromUrl = function (options) {
                                
                                        var opt = $.extend({}, {
                                            listName: "" // [Optional] Pass in the name or GUID of a list if you are not in its context. e.g., on a Web Part pages in the Pages library
                                        }, options);
                                Severity: Minor
                                Found in src/utils/SPListNameFromUrl.js - About 1 hr to fix

                                  Function attrToJson has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function attrToJson(v, objectType) {
                                          function identity(x) { return x; }
                                  
                                          var result = {
                                  
                                  
                                  Severity: Minor
                                  Found in src/utils/SPXmlToJson.js - About 1 hr to fix

                                    Function SPGetStaticFromDisplay has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        $.fn.SPServices.SPGetStaticFromDisplay = function (options) {
                                    
                                            var opt = $.extend({}, {
                                                webURL: "", // URL of the target Web.  If not specified, the current Web is used.
                                                listName: "", // The name or GUID of the list
                                    Severity: Minor
                                    Found in src/utils/SPGetStaticFromDisplay.js - About 1 hr to fix

                                      Function SPGetDisplayFromStatic has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $.fn.SPServices.SPGetDisplayFromStatic = function (options) {
                                      
                                              var opt = $.extend({}, {
                                                  webURL: "", // URL of the target Web.  If not specified, the current Web is used.
                                                  listName: "", // The name or GUID of the list
                                      Severity: Minor
                                      Found in src/utils/SPGetDisplayFromStatic.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language