abelevtsov/XrmSoapSDK

View on GitHub

Showing 49 of 101 total issues

File xrm.soap.sdk.js has 2126 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(global) {
    global.Type.registerNamespace("Xrm.Soap.Sdk");
})(this);

(function(global) {
Severity: Major
Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 5 days to fix

    Function Entity has 302 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.Entity = (function() {
            /**
             * Universal class for creating, updating and deleting any entity
             * @param {String} logicalName
             * @param {Guid} id
    Severity: Major
    Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 day to fix

      Function OrganizationService has 273 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.OrganizationService = (function() {
              var url = splittedUrl[0] + "//" + splittedUrl[1],
                  serviceUrl = url + (splittedUrl.length === 3 && splittedUrl[2] === orgName ? (`/${orgName}`) : "") + xrmServiceUrl,
                  soapTemplate = compile([
                      utf8Root,
      Severity: Major
      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 1 day to fix

        File xrm.common.js has 427 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Type.registerNamespace("Xrm.Common");
        
        (function(global) {
            "use strict";
        
        
        Severity: Minor
        Found in src/Xrm.Soap.Sdk/js/xrm.common.js - About 6 hrs to fix

          Function CrmProvider has 145 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.CrmProvider = (function() {
                  const entityMetadataType = "EntityMetadata";
                  const orgService = new self.OrganizationService();
                  const crmProvider = function() {};
          
          
          Severity: Major
          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 5 hrs to fix

            Function deserialize has 121 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    entity.deserialize = function(resultNode) {
                        var obj = {},
                            resultNodes = resultNode.childNodes,
                            instance = new self.Entity(),
            
            
            Severity: Major
            Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 4 hrs to fix

              Function objectifyNode has 113 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      objectifyNode = function(node) {
                          if (node.attributes && node.attributes.length === 1) {
                              var nil = node.attributes.getNamedItem("i:nil");
                              if (nil && nil.nodeValue === trueString) {
                                  return null;
              Severity: Major
              Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 4 hrs to fix

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

                            serialize: function() {
                                var xml = [`<entity xmlns:a='${contractsXrmNs}'>`],
                                    counter = 1;
                
                                xml[counter++] = `<a:Attributes xmlns:b='${genericNs}'>`;
                Severity: Major
                Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 4 hrs to fix

                  Function QueryExpression has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.QueryExpression = (function() {
                          const queryTemplate = compile(`<query i:type='a:QueryExpression' xmlns:a='${contractsXrmNs}'><%= query %></query>`);
                          const criteriaTemplate = compile("<a:Criteria><%= conditions %><a:FilterOperator><%= filterOperator %></a:FilterOperator><a:Filters></a:Filters></a:Criteria>");
                          const conditionsTemplate = compile("<a:Conditions><% _.each(conditions, function(condition) { %><%= condition.serialize() %><% }) %></a:Conditions>");
                          const linkEntitiesTemplate = compile("<a:LinkEntities><% _.each(linkEntities, function(entity) { %><%= entity.serialize() %><% }) %></a:LinkEntities>");
                  Severity: Major
                  Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 3 hrs to fix

                    Function QueryByAttribute has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.QueryByAttribute = (function() {
                            const queryTemplate = compile(`<query i:type='a:QueryByAttribute' xmlns:a='${contractsXrmNs}'><%= query %></query>`);
                            const ordersTemplate = compile("<a:Orders><% _.each(orders, function(order) { %><%= order %><% }) %></a:Orders>");
                            const attributesTemplate = compile(`<a:Attributes xmlns:b='${arraysNs}'><% _.each(attributes, function(attribute) { %><%= attribute %><% }) %></a:Attributes>`);
                            const valuesTemplate = compile(`<a:Values xmlns:b='${arraysNs}'><% _.each(values, function(value) { %><%= value %><% }) %></a:Values>`);
                    Severity: Major
                    Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 3 hrs to fix

                      Function ConditionOperator has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          this.ConditionOperator = (function() {
                              return {
                                  Equal: "Equal",
                                  NotEqual: "NotEqual",
                                  GreaterThan: "GreaterThan",
                      Severity: Major
                      Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 3 hrs to fix

                        Function ColumnSet has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.ColumnSet = (function() {
                                const columnsTemplate = compile(`<a:AllColumns><%= allColumns %></a:AllColumns><a:Columns xmlns:b='${arraysNs}'><% _.each(columns, function(column) { %><%= column %><% }) %></a:Columns>`);
                                const columnSetTemplate = compile("<a:ColumnSet><%= columnSet %></a:ColumnSet>");
                                const asLinkColumnSetTemplate = compile("<a:Columns><%= columnSet %></a:Columns>");
                                const simpleColumnSetTemplate = compile(`<columnSet xmlns:a='${contractsXrmNs}'><%= columnSet %></columnSet>`);
                        Severity: Major
                        Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (c > 96 && c < 123 || c > 64 && c < 91 || c === 32 || c > 47 && c < 58 || c === 46 || c === 44 || c === 45 || c === 95) {
                                              buffer += String.fromCharCode(c);
                                          } else {
                                              buffer += `&#${c};`;
                                          }
                          Severity: Critical
                          Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 2 hrs to fix

                            Function SetStateRequest has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function ExecuteActionRequest has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function Guid has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    this.Guid = (function() {
                                        const regex = /^(\{){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(\}){0,1}$/;
                                        const empty = "{00000000-0000-0000-0000-000000000000}";
                                        const ctor = function(value) {
                                            if (typeof(value) === "object" &&
                                Severity: Major
                                Found in src/Xrm.Soap.Sdk/js/xrm.soap.sdk.js - About 2 hrs to fix

                                  Function RetrieveEntityRequest has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    Function RetrieveAttributeRequest has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

                                      Function addNotification has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          this.addNotification = function(id, level, source, message) {
                                              /// <summary>
                                              /// Add a notification bar message with CRM 2011 style
                                              /// </summary>
                                              /// <param name="message" type="String">
                                      Severity: Minor
                                      Found in src/Xrm.Soap.Sdk/js/xrm.common.js - About 2 hrs to fix

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