sympmarc/SPServices

View on GitHub

Showing 105 of 105 total issues

Function completefunc has 99 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/SPFilterDropdown.js - About 3 hrs to fix

    File SPDisplayRelatedInfo.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    define([
        'jquery',
        "../utils/constants",
        '../core/SPServices.utils',
        //---------------------------
    Severity: Minor
    Found in src/value-added/SPDisplayRelatedInfo.js - About 3 hrs to fix

      File SPCascadeDropdowns.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      define([
          'jquery',
          '../utils/constants',
          '../core/SPServices.utils',
          //---------------------------
      Severity: Minor
      Found in src/value-added/SPCascadeDropdowns.js - About 3 hrs to fix

        Function SPGetListItemsJson has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

              $.fn.SPServices.SPFindPeoplePicker = function (options) {
          
                  var opt = $.extend({}, {
                      peoplePickerDisplayName: "", // The displayName of the People Picker on the form
                      valueToSet: "", // The value to set the People Picker to. Should be a string containing each username or groupname separated by semi-colons.
          Severity: Major
          Found in src/value-added/SPFindPeoplePicker.js - About 2 hrs to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                if (typeof thisValue !== "undefined" && thisValue.indexOf(constants.spDelim) > 0) {
                                    thisOption = new utils.SplitIndex(thisValue);
                                } else {
                                    thisOption.id = $(this).attr("ows_ID");
                                    thisOption.value = thisValue;
            Severity: Major
            Found in src/value-added/SPFilterDropdown.js and 1 other location - About 2 hrs to fix
            src/value-added/SPCascadeDropdowns.js on lines 309..314

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 90.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                    if (typeof thisValue !== "undefined" && thisValue.indexOf(constants.spDelim) > 0) {
                                        thisOption = new utils.SplitIndex(thisValue);
                                    } else {
                                        thisOption.id = $(this).attr("ows_ID");
                                        thisOption.value = thisValue;
            Severity: Major
            Found in src/value-added/SPCascadeDropdowns.js and 1 other location - About 2 hrs to fix
            src/value-added/SPFilterDropdown.js on lines 151..156

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 90.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function SPRequireUnique has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.SPServices.SPRequireUnique = function (options) {
            
                    var opt = $.extend({}, {
                        columnStaticName: "Title", // Name of the column
                        duplicateAction: 0, // 0 = warn, 1 = prevent
            Severity: Major
            Found in src/value-added/SPRequireUnique.js - About 2 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      $(thisMultiSelect.master.candidateControl).find("option").each(function () {
                          cloneObj.append("<option value='" + $(this).html() + "'>" + $(this).html() + "</option>");
                      });
              Severity: Major
              Found in src/value-added/SPSetMultiSelectSizes.js and 1 other location - About 2 hrs to fix
              src/value-added/SPSetMultiSelectSizes.js on lines 59..61

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      $(thisMultiSelect.master.resultControl).find("option").each(function () {
                          cloneObj.append("<option value='" + $(this).val() + "'>" + $(this).html() + "</option>");
                      });
              Severity: Major
              Found in src/value-added/SPSetMultiSelectSizes.js and 1 other location - About 2 hrs to fix
              src/value-added/SPSetMultiSelectSizes.js on lines 55..57

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function SPDisplayRelatedInfo has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.SPServices.SPDisplayRelatedInfo = 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: Major
              Found in src/value-added/SPDisplayRelatedInfo.js - About 2 hrs to fix

                Function SPLookupAddNew has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.fn.SPServices.SPLookupAddNew = function (options) {
                
                        var opt = $.extend({}, {
                            lookupColumn: "", // The display name of the Lookup column
                            promptText: "Add new {0}", // Text to use as prompt + column name
                Severity: Major
                Found in src/value-added/SPLookupAddNew.js - About 2 hrs to fix

                  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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        QUnit.test("SPGetStaticFromDisplay", function(assert) {
                    
                            assert.expect(1);
                    
                            var thisStaticName =  $().SPServices.SPGetStaticFromDisplay({
                    Severity: Major
                    Found in test/Lists.js and 1 other location - About 2 hrs to fix
                    test/Lists.js on lines 79..90

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 83.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          QUnit.test("SPGetDisplayFromStatic", function(assert) {
                      
                              assert.expect(1);
                      
                              var thisDisplayName =  $().SPServices.SPGetDisplayFromStatic({
                      Severity: Major
                      Found in test/Lists.js and 1 other location - About 2 hrs to fix
                      test/Lists.js on lines 92..103

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 83.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      case "QueryEx":
                                          SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";
                                          SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation;
                                          SOAPEnvelope.payload += utils.wrapNode("queryXml", constants.encodeXml(opt.queryXml));
                                          break;
                          Severity: Major
                          Found in src/core/SPServices.core.js and 1 other location - About 2 hrs to fix
                          src/core/SPServices.core.js on lines 650..654

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 75.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      case "GetQuerySuggestions":
                                          SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>";
                                          SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation;
                                          SOAPEnvelope.payload += utils.wrapNode("queryXml", constants.encodeXml(opt.queryXml));
                                          break;
                          Severity: Major
                          Found in src/core/SPServices.core.js and 1 other location - About 2 hrs to fix
                          src/core/SPServices.core.js on lines 662..666

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 75.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language