abelevtsov/XrmSoapSDK

View on GitHub

Showing 101 of 101 total issues

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

                for (let i = 0, l = response.length; i < l; i++) {
                    const a = objectifyNode(response[i]);
                    a._type = entityMetadataType;
                    results[results.length] = a;
                }
Severity: Major
Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2785..2789

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

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

                for (let i = 0, l = response.length; i < l; i++) {
                    const a = objectifyNode(response[i]);
                    a._type = entityMetadataType;
                    results[results.length] = a;
                }
Severity: Major
Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2714..2718

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

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 LinkEntity has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.LinkEntity = (function() {
        const template = compile([
            "<a:LinkEntity>",
              "<%= columns %>",
              "<a:EntityAlias i:nil='true'/>",
Severity: Minor
Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

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

                    for (let i = 0, l = fetchResult.childNodes.length; i < l; i++) {
                        fetchResults[fetchResults.length] = self.Entity.deserialize(fetchResult.childNodes[i]);
                    }
    Severity: Major
    Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
    src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2298..2300

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

    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 openCustomLookupDialog has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.openCustomLookupDialog = function(config) {
            const callee = config.callee;
            const lookupStyle = config.lookupStyle;
            const lookupTypes = config.lookupTypes;
            const additionalParams = config.additionalParams;
    Severity: Minor
    Found in src/Xrm.Soap.Sdk/js/xrm.common.js - About 1 hr to fix

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

                      for (let i = 0, l = fetchResult.childNodes.length; i < l; i++) {
                          fetchResults[fetchResults.length] = self.Entity.deserialize(fetchResult.childNodes[i]);
                      }
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2532..2534

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

      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

                  update: function(entity) {
                      const result = executeSync(entity.serialize(), "Update");
                      return result && !(result instanceof Error) ? $(result).find("UpdateResponse").text() : result;
                  },
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2162..2165

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

      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

                  create: function(entity) {
                      const result = executeSync(entity.serialize(), "Create");
                      return result && !(result instanceof Error) ? $(result).find("CreateResult").text() : result;
                  },
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2171..2174

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

      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 ExecuteGlobalActionRequest has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.ExecuteGlobalActionRequest = (function(base) {
              const template = compile([
                  `<request  xmlns:a='${contractsXrmNs}' xmlns:i='${xmlSchemaInstanceNs}' xmlns:b='${genericNs}'>`,
                    "<%= parameters %>",
                    "<a:RequestId i:nil='true'/>",
      Severity: Minor
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

        Function FilterExpression has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.FilterExpression = (function() {
                const template = compile([
                    "<a:LinkCriteria>",
                         "<a:Conditions>",
                             "<% _.each(conditions, function(condition) { %><%= condition %><% }) %>",
        Severity: Minor
        Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

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

                  ctor.prototype.noLock = function(/* value */) {
                      if (arguments && arguments.length === 1) {
                          this.noLock = !!arguments[0];
                      }
          
          
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 3 other locations - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 849..855
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 857..863
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 991..997

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

          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

                  ctor.prototype.distinct = function(/* value */) {
                      if (arguments && arguments.length === 1) {
                          this.distinct = !!arguments[0];
                      }
          
          
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 3 other locations - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 849..855
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 857..863
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 999..1005

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

          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

                          for (let i = 0, l = resultNodes.childNodes.length; i < l; i++) {
                              retrieveMultipleResults[i] = self.Entity.deserialize(resultNodes.childNodes[i]);
                          }
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2249..2251

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

          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

                  ctor.prototype.distinct = function(/* value */) {
                      if (arguments && arguments.length === 1) {
                          this.distinct = !!arguments[0];
                      }
          
          
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 3 other locations - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 857..863
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 991..997
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 999..1005

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

          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

                  ctor.prototype.noLock = function(/* value */) {
                      if (arguments && arguments.length === 1) {
                          this.noLock = !!arguments[0];
                      }
          
          
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 3 other locations - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 849..855
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 991..997
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 999..1005

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

          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

                          for (let i = 0, l = resultNodes.childNodes.length; i < l; i++) {
                              retrieveMultipleResults[i] = self.Entity.deserialize(resultNodes.childNodes[i]);
                          }
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
          src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2470..2472

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

          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 ExecuteWorkflowRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.ExecuteWorkflowRequest = (function(base) {
                  const template = compile([
                          `<request i:type='b:ExecuteWorkflowRequest' xmlns:a='${contractsXrmNs}' xmlns:b='${contractsCrmNs}'>`,
                            `<a:Parameters xmlns:c='${genericNs}'>`,
                              "<a:KeyValuePairOfstringanyType>",
          Severity: Minor
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

            Function RetrieveAllEntitiesRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.RetrieveAllEntitiesRequest = (function(base) {
                    const template = compile([
                            `<request i:type='a:RetrieveAllEntitiesRequest' xmlns:a='${contractsXrmNs}'>`,
                              `<a:Parameters xmlns:b='${genericNs}'>`,
                                "<a:KeyValuePairOfstringanyType>",
            Severity: Minor
            Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

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

                              if ($resultXml.find("a\\:Entities").length) {
                                  resultNodes = $resultXml.find("a\\:Entities")[0];
                              } else {
                                  // chrome could not load node properly
                                  resultNodes = $resultXml.find("Entities")[0];
              Severity: Major
              Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
              src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2458..2463

              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

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

                              if ($resultXml.find("a\\:Entities").length) {
                                  resultNodes = $resultXml.find("a\\:Entities")[0];
                              } else {
                                  // chrome could not load node properly
                                  resultNodes = $resultXml.find("Entities")[0];
              Severity: Major
              Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 1 other location - About 1 hr to fix
              src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 2237..2242

              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

              Severity
              Category
              Status
              Source
              Language