abelevtsov/XrmSoapSDK

View on GitHub

Showing 49 of 101 total issues

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

    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

        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

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

                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

                                Function PageInfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    this.PageInfo = (function() {
                                        const template = compile([
                                            "<a:PageInfo>",
                                                "<a:Count><%= count %></a:Count>",
                                                "<a:PageNumber><%= pageNumber %></a:PageNumber>",
                                Severity: Minor
                                Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

                                  Function isMetadataArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          isMetadataArray = (function() {
                                              var arrayElements = [
                                                      "Attributes",
                                                      "ManyToManyRelationships",
                                                      "ManyToOneRelationships",
                                  Severity: Minor
                                  Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 hr to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if (entCv.type === "int") {
                                                                            entCv.value = parseInt($(attr.childNodes[k].childNodes[1]).text());
                                                                        } else if (entCv.type === "decimal" || entCv.type === "double") {
                                                                            entCv.value = parseFloat($(attr.childNodes[k].childNodes[1]).text());
                                                                        } else if (entCv.type === "dateTime") {
                                    Severity: Major
                                    Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                          for (var y = 0; y < childNodes.length; y++) {
                                                                              var itemNodes = childNodes[y].childNodes[0].childNodes;
                                                                              for (var z = 0; z < itemNodes.length; z++) {
                                                                                  if ($(itemNodes[z].childNodes[0]).text() !== "partyid") {
                                                                                      continue;
                                      Severity: Major
                                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                        if (attributes[l].nodeName === "i:type") {
                                                                            sType = ($(attributes[l]).val() || "")
                                                                                .replace("c:", "")
                                                                                .replace("a:", "");
                                                                            break;
                                        Severity: Major
                                        Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language