sympmarc/SPServices

View on GitHub
src/core/SPServices.core.js

Summary

Maintainability
F
1 wk
Test Coverage

Function SPServices has 869 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.SPServices = function (options) {

        // If there are no options passed in, use the defaults.  Extend replaces each default with the passed option.
        var opt = $.extend({}, $.fn.SPServices.defaults, options);

Severity: Major
Found in src/core/SPServices.core.js - About 4 days to fix

    File SPServices.core.js has 1182 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Original SPServices core modules...
     */
    define([
        "jquery",
    Severity: Major
    Found in src/core/SPServices.core.js - About 3 days 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

      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

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

                              SOAPEnvelope.payload += "<Field Name='" + opt.valuepairs[i][0] + "'>" + utils.escapeColumnValue(opt.valuepairs[i][1]) + "</Field>";
      Severity: Minor
      Found in src/core/SPServices.core.js and 1 other location - About 45 mins to fix
      src/value-added/SPUpdateMultipleListItems.js on lines 57..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 50.

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

                  case webServices.USERGROUP:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/directory/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/directory/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 397..400

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

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

                  case webServices.WORKFLOW:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/workflow/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/workflow/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 385..388

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

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

                  case webServices.TAXONOMYSERVICE:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/taxonomy/soap/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/taxonomy/soap/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 385..388
      src/core/SPServices.core.js on lines 397..400

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

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

                  case webServices.PERMISSIONS:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/directory/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/directory/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 385..388
      src/core/SPServices.core.js on lines 397..400

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

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

                  case webServices.MEETINGS:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/meetings/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/meetings/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 385..388
      src/core/SPServices.core.js on lines 397..400

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

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

                  case webServices.ALERTS:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/2002/1/alerts/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/2002/1/alerts/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 353..356
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 385..388
      src/core/SPServices.core.js on lines 397..400

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

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

                  case webServices.OFFICIALFILE:
                      SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/recordsrepository/' >";
                      SOAPAction = constants.SCHEMASharePoint + "/soap/recordsrepository/";
                      break;
      Severity: Major
      Found in src/core/SPServices.core.js and 6 other locations - About 35 mins to fix
      src/core/SPServices.core.js on lines 345..348
      src/core/SPServices.core.js on lines 349..352
      src/core/SPServices.core.js on lines 357..360
      src/core/SPServices.core.js on lines 381..384
      src/core/SPServices.core.js on lines 385..388
      src/core/SPServices.core.js on lines 397..400

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

      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

      There are no issues that match your filters.

      Category
      Status