abelevtsov/XrmSoapSDK

View on GitHub

Showing 101 of 101 total issues

Function EntityReference has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.EntityReference = (function() {
        /**
         * Like EntityReference in Microsoft.Xrm.Sdk
         * @param {String} logicalName Entity logical name
         * @param {Guid} id Entity Id
Severity: Minor
Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

    Function queryExpressionExample has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            queryExpressionExample = function() {
                const query = new QueryExpression(
                    "contact",
                    [
                        new ConditionExpression("middlename", soap.ConditionOperator.NotNull),
    Severity: Minor
    Found in src/Xrm.Soap.Sdk/js/examples.js - About 1 hr to fix

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

              ctor.prototype.addLink = function(linkEntity) {
                  linkEntity && linkEntity instanceof self.LinkEntity && (this.linkEntities[this.linkEntities.length] = linkEntity);
              };
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 2 other locations - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 654..656
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 950..952

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

              ctor.prototype.addOrder = function(order) {
                  order && order instanceof self.OrderExpression && (this.orders[this.orders.length] = order);
              };
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 2 other locations - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 654..656
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 977..979

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

              ctor.prototype.addCondition = function(condition) {
                  condition && condition instanceof self.ConditionExpression && (this.conditions[this.conditions.length] = condition);
              };
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 2 other locations - About 1 hr to fix
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 950..952
      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 977..979

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

          this.setFormViewMode = function(readOnly) {
              try {
                  if (readOnly) {
                      if (!Xrm.Page.ui) {
                          setTimeout(self.setFormViewMode, 100);
      Severity: Minor
      Found in src/Xrm.Soap.Sdk/js/xrm.common.js - About 1 hr to fix

        Function serialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                ctor.prototype.serialize = function() {
                    // ToDo: improve result creation
                    var result = [];
                    if (this.attributes.length) {
                        result.push(attributesTemplate({
        Severity: Minor
        Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

          Function RetrieveSharedPrincipalsAndAccessRequest has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.RetrieveSharedPrincipalsAndAccessRequest = (function(base) {
                  const template = compile([
                          `<request i:type='b:RetrieveSharedPrincipalsAndAccessRequest' xmlns:a='${contractsXrmNs}' xmlns:i='${xmlSchemaInstanceNs}' 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 innerSurrogateAmpersandWorkaround has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    innerSurrogateAmpersandWorkaround = function(s) {
                        var buffer = "",
                            c0,
                            cnt,
                            l;
            Severity: Minor
            Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

              Function ConditionExpression has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.ConditionExpression = (function() {
                      const valueTemplate = compile("<b:anyType i:type='c:<%= type %>' xmlns:c='<%= xmlns %>'><%= value %></b:anyType>");
                      const valuesTemplate = compile(`<a:Values xmlns:b='${arraysNs}'><% _.each(values, function(value) { %><%= value %><% }) %></a:Values>`);
                      const conditionExpressionTemplate = compile("<a:ConditionExpression><a:AttributeName><%= attributeName %></a:AttributeName><a:Operator><%= operator %></a:Operator><%= values %></a:ConditionExpression>");
              
              
              Severity: Minor
              Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

                Function crmProviderExample has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        crmProviderExample = function() {
                            crmProvider.retrieveAllEntitiesMetadataAsync(soap.EntityFilters.All, true).then(function(allEntitiesMetadata) {
                                console.log(allEntitiesMetadata);
                            }).then(function() {
                                crmProvider.retrieveEntityMetadataAsync(soap.EntityFilters.All, "contact", true).then(function(contactMetadata) {
                Severity: Minor
                Found in src/Xrm.Soap.Sdk/js/examples.js - About 1 hr to fix

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

                          crudExample = function() {
                              const contact = new Entity("contact");
                              contact.setAttribute("parentcustomerid", new EntityReference("account", new Guid("8A2C9BB0-2E7D-E311-A409-00155D011E01")));
                              contact.setAttribute("firstname", "test");
                              contact.setAttribute("new_int", 123);
                  Severity: Minor
                  Found in src/Xrm.Soap.Sdk/js/examples.js - About 1 hr to fix

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

                        this.isUserInRole = function(roleName) {
                            var serverUrl = xrmPage.context.getClientUrl(),
                                odataPath = "/xrmservices/2011/organizationdata.svc",
                                oDataEndpointUrl = serverUrl + odataPath + "/RoleSet",
                                requestResults = [],
                    Severity: Minor
                    Found in src/Xrm.Soap.Sdk/js/xrm.common.js - About 1 hr to fix

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

                          this.RequestParameter = (function() {
                              const ctor = function(name, value) {
                                  this.name = name;
                                  this.value = value;
                              };
                      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 1614..1621

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

                          this.XrmValue = (function() {
                              const ctor = function(value, type) {
                                  this.value = value;
                                  this.type = type;
                              };
                      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 1623..1630

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

                          this.Money = (function() {
                              const ctor = function(value) {
                                  this.value = value;
                                  this.type = "Money";
                              };
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 4 other locations - About 1 hr to fix
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1459..1466
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1534..1541
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1596..1603
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1605..1612

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

                          this.StatusCode = (function() {
                              const ctor = function(value) {
                                  this.value = value;
                                  this.type = "int";
                              };
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 4 other locations - About 1 hr to fix
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1450..1457
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1459..1466
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1534..1541
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1596..1603

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

                          this.Decimal = (function() {
                              const ctor = function(value) {
                                  this.value = value;
                                  this.type = "decimal";
                              };
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 4 other locations - About 1 hr to fix
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1450..1457
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1534..1541
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1596..1603
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1605..1612

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

                          this.EntityCollection = (function() {
                              const entityCollection = function(value) {
                                  this.value = value;
                                  this.type = "EntityCollection";
                              };
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 4 other locations - About 1 hr to fix
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1450..1457
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1459..1466
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1596..1603
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1605..1612

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

                          this.StateCode = (function() {
                              const ctor = function(value) {
                                  this.value = value;
                                  this.type = "int";
                              };
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js and 4 other locations - About 1 hr to fix
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1450..1457
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1459..1466
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1534..1541
                      src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js on lines 1605..1612

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language