sympmarc/SPServices

View on GitHub

Showing 105 of 105 total issues

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

    QUnit.test("SPGetCurrentUser", function (assert) {
        var currentUser = $().SPServices.SPGetCurrentUser();
        assert.ok(currentUser !== undefined, "Passed! SPCurrentUser =::" + currentUser + "::");
    });
Severity: Major
Found in test/general.js and 3 other locations - About 1 hr to fix
test/general.js on lines 18..21
test/general.js on lines 23..26
test/general.js on lines 33..36

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 63.

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

            completefunc: function (xData) {
                $(xData.responseXML).find("User").each(function () {
                    userId = $(this).attr("ID");
                });
            }
Severity: Major
Found in src/utils/SPGetLastItemId.js and 1 other location - About 1 hr to fix
src/utils/SPGetLastItemId.js on lines 60..64

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 62.

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

            completefunc: function (xData) {
                $(xData.responseXML).SPFilterNode("z:row").each(function () {
                    lastId = $(this).attr("ows_ID");
                });
            }
Severity: Major
Found in src/utils/SPGetLastItemId.js and 1 other location - About 1 hr to fix
src/utils/SPGetLastItemId.js on lines 32..36

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 62.

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 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

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

                                    if (typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) {
                                        utils.errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList");
                                        return;
                                    }
    Severity: Major
    Found in src/value-added/SPDisplayRelatedInfo.js and 1 other location - About 1 hr to fix
    src/value-added/SPDisplayRelatedInfo.js on lines 202..205

    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 59.

    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

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

                                if (typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) {
                                    utils.errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList");
                                    return;
                                }
    Severity: Major
    Found in src/value-added/SPDisplayRelatedInfo.js and 1 other location - About 1 hr to fix
    src/value-added/SPDisplayRelatedInfo.js on lines 224..227

    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 59.

    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 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

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

              if (columnSelect.Obj.html() === null && opt.debug) {
                  utils.errBox(thisFunction, "columnName: " + opt.columnName, constants.TXTColumnNotFound);
                  return;
              }
      Severity: Major
      Found in src/value-added/SPFilterDropdown.js and 3 other locations - About 1 hr to fix
      src/value-added/SPCascadeDropdowns.js on lines 50..53
      src/value-added/SPCascadeDropdowns.js on lines 59..62
      src/value-added/SPDisplayRelatedInfo.js on lines 47..50

      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 58.

      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 4 locations. Consider refactoring.
      Open

              if (childSelect.Obj.html() === null && opt.debug) {
                  utils.errBox(thisFunction, "childColumn: " + opt.childColumn, constants.TXTColumnNotFound);
                  return;
              }
      Severity: Major
      Found in src/value-added/SPCascadeDropdowns.js and 3 other locations - About 1 hr to fix
      src/value-added/SPCascadeDropdowns.js on lines 50..53
      src/value-added/SPDisplayRelatedInfo.js on lines 47..50
      src/value-added/SPFilterDropdown.js on lines 50..53

      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 58.

      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 4 locations. Consider refactoring.
      Open

              if (columnSelect.Obj.html() === null && opt.debug) {
                  utils.errBox(thisFunction, "columnName: " + opt.columnName, constants.TXTColumnNotFound);
                  return;
              }
      Severity: Major
      Found in src/value-added/SPDisplayRelatedInfo.js and 3 other locations - About 1 hr to fix
      src/value-added/SPCascadeDropdowns.js on lines 50..53
      src/value-added/SPCascadeDropdowns.js on lines 59..62
      src/value-added/SPFilterDropdown.js on lines 50..53

      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 58.

      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 4 locations. Consider refactoring.
      Open

              if (parentSelect.Obj.html() === null && opt.debug) {
                  utils.errBox(thisFunction, "parentColumn: " + opt.parentColumn, constants.TXTColumnNotFound);
                  return;
              }
      Severity: Major
      Found in src/value-added/SPCascadeDropdowns.js and 3 other locations - About 1 hr to fix
      src/value-added/SPCascadeDropdowns.js on lines 59..62
      src/value-added/SPDisplayRelatedInfo.js on lines 47..50
      src/value-added/SPFilterDropdown.js on lines 50..53

      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 58.

      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 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

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

                        for (i = 0; i < opt.DestinationUrls.length; i++) {
                            SOAPEnvelope.payload += utils.wrapNode("string", opt.DestinationUrls[i]);
                        }
        Severity: Major
        Found in src/core/SPServices.core.js and 2 other locations - About 1 hr to fix
        src/core/SPServices.core.js on lines 432..434
        src/core/SPServices.core.js on lines 449..451

        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 57.

        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 3 locations. Consider refactoring.
        Open

                        for (i = 0; i < opt.IDs.length; i++) {
                            SOAPEnvelope.payload += constants.wrapNode("string", opt.IDs[i]);
                        }
        Severity: Major
        Found in src/core/SPServices.core.js and 2 other locations - About 1 hr to fix
        src/core/SPServices.core.js on lines 449..451
        src/core/SPServices.core.js on lines 458..460

        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 57.

        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 3 locations. Consider refactoring.
        Open

                        for (i = 0; i < opt.DestinationUrls.length; i++) {
                            SOAPEnvelope.payload += utils.wrapNode("string", opt.DestinationUrls[i]);
                        }
        Severity: Major
        Found in src/core/SPServices.core.js and 2 other locations - About 1 hr to fix
        src/core/SPServices.core.js on lines 432..434
        src/core/SPServices.core.js on lines 458..460

        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 57.

        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 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

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

                  if (thisMultiSelect.Obj.html() === null && opt.debug) {
                      utils.errBox(thisFunction, "multiSelectColumn: " + opt.multiSelectColumn, constants.TXTColumnNotFound);
                      return;
                  }
          Severity: Major
          Found in src/value-added/SPSetMultiSelectSizes.js and 1 other location - About 1 hr to fix
          src/value-added/SPLookupAddNew.js on lines 38..41

          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 56.

          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 (lookupSelect.Obj.html() === null && opt.debug) {
                      utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, constants.TXTColumnNotFound);
                      return;
                  }
          Severity: Major
          Found in src/value-added/SPLookupAddNew.js and 1 other location - About 1 hr to fix
          src/value-added/SPSetMultiSelectSizes.js on lines 35..38

          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 56.

          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 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
              Severity
              Category
              Status
              Source
              Language