Showing 49 of 101 total issues
Function openCustomLookupDialog
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.openCustomLookupDialog = function(config) {
const callee = config.callee;
const lookupStyle = config.lookupStyle;
const lookupTypes = config.lookupTypes;
const additionalParams = config.additionalParams;
Function ExecuteGlobalActionRequest
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.ExecuteGlobalActionRequest = (function(base) {
const template = compile([
`<request xmlns:a='${contractsXrmNs}' xmlns:i='${xmlSchemaInstanceNs}' xmlns:b='${genericNs}'>`,
"<%= parameters %>",
"<a:RequestId i:nil='true'/>",
Function FilterExpression
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.FilterExpression = (function() {
const template = compile([
"<a:LinkCriteria>",
"<a:Conditions>",
"<% _.each(conditions, function(condition) { %><%= condition %><% }) %>",
Function RetrieveAllEntitiesRequest
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.RetrieveAllEntitiesRequest = (function(base) {
const template = compile([
`<request i:type='a:RetrieveAllEntitiesRequest' xmlns:a='${contractsXrmNs}'>`,
`<a:Parameters xmlns:b='${genericNs}'>`,
"<a:KeyValuePairOfstringanyType>",
Function ExecuteWorkflowRequest
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>",
Function EntityReference
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.EntityReference = (function() {
/**
* Like EntityReference in Microsoft.Xrm.Sdk
* @param {String} logicalName Entity logical name
* @param {Guid} id Entity Id
Function queryExpressionExample
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
queryExpressionExample = function() {
const query = new QueryExpression(
"contact",
[
new ConditionExpression("middlename", soap.ConditionOperator.NotNull),
Function setFormViewMode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setFormViewMode = function(readOnly) {
try {
if (readOnly) {
if (!Xrm.Page.ui) {
setTimeout(self.setFormViewMode, 100);
Function serialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ctor.prototype.serialize = function() {
// ToDo: improve result creation
var result = [];
if (this.attributes.length) {
result.push(attributesTemplate({
Function RetrieveSharedPrincipalsAndAccessRequest
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>",
Function innerSurrogateAmpersandWorkaround
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
innerSurrogateAmpersandWorkaround = function(s) {
var buffer = "",
c0,
cnt,
l;
Function ConditionExpression
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>");
Function crmProviderExample
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function crudExample
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function isUserInRole
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.isUserInRole = function(roleName) {
var serverUrl = xrmPage.context.getClientUrl(),
odataPath = "/xrmservices/2011/organizationdata.svc",
oDataEndpointUrl = serverUrl + odataPath + "/RoleSet",
requestResults = [],
Function PageInfo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.PageInfo = (function() {
const template = compile([
"<a:PageInfo>",
"<a:Count><%= count %></a:Count>",
"<a:PageNumber><%= pageNumber %></a:PageNumber>",
Function isMetadataArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
isMetadataArray = (function() {
var arrayElements = [
"Attributes",
"ManyToManyRelationships",
"ManyToOneRelationships",
Avoid deeply nested control flow statements. Open
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") {
Avoid deeply nested control flow statements. Open
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;
Avoid deeply nested control flow statements. Open
Open
if (attributes[l].nodeName === "i:type") {
sType = ($(attributes[l]).val() || "")
.replace("c:", "")
.replace("a:", "");
break;