camelCaseDave/xrm-mock

View on GitHub

Showing 99 of 99 total issues

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

    public fail<U>(onRejected?: (reason: Xrm.ErrorResponse) => U | Xrm.Async.PromiseLike<U>): Xrm.Async.PromiseLike<U> {
        return new XrmPromiseMock<U>(this.promise.catch(onRejected) as Promise<U>);
    }
Severity: Major
Found in src/xrm-mock/async/xrmpromise/xrmpromise.mock.ts and 1 other location - About 3 hrs to fix
src/xrm-mock/async/xrmpromise/xrmpromise.mock.ts on lines 22..24

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

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

  constructor(components: ILookupOptionsComponents) {
    this.allowMultiSelect = components.allowMultiSelect;
    this.defaultEntityType = components.defaultEntityType;
    this.defaultViewId = components.defaultViewId;
    this.entityTypes = components.entityTypes;
Severity: Major
Found in src/xrm-mock/lookupoptions/lookupoptions.mock.ts and 1 other location - About 3 hrs to fix
src/xrm-mock/metadata/attributemetadata/attributemetadata.mock.ts on lines 9..16

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

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

  constructor(components: IAttributeMetadataComponents) {
    this.DefaultFormValue = components.DefaultFormValue;
    this.LogicalName = components.LogicalName;
    this.DisplayName = components.DisplayName;
    this.AttributeType = components.AttributeType;
src/xrm-mock/lookupoptions/lookupoptions.mock.ts on lines 12..19

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

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

ProcessManagerMock has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

export class ProcessManagerMock implements Xrm.ProcessFlow.ProcessManager {
    public enabledProcesses: Xrm.Page.Process[] | Xrm.ProcessFlow.ProcessDictionary;

    constructor(enabledProcesses: Xrm.ProcessFlow.Process[]) {
        this.enabledProcesses = enabledProcesses;
Severity: Minor
Found in src/xrm-mock/processflow/processmanager/processmanager.mock.ts - About 3 hrs to fix

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

        public removePreSearch(handler: Xrm.Events.ContextSensitiveHandler): void {
            let index = this.preSearchHandlers.indexOf(handler);
            while (index >= 0) {
                this.preSearchHandlers.splice(index, 1);
                index = this.preSearchHandlers.indexOf(handler);
    Severity: Major
    Found in src/xrm-mock/controls/lookupcontrol/lookupcontrol.mock.ts and 1 other location - About 2 hrs to fix
    src/xrm-mock/controls/lookupcontrol/lookupcontrol.mock.ts on lines 100..106

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

    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

        public removeOnLookupTagClick(handler: Xrm.Events.LookupTagClickHandler): void {
            let index = this.onLookupTagHandlers.indexOf(handler)
            while (index >= 0) {
                this.onLookupTagHandlers.splice(index, 1);
                index = this.onLookupTagHandlers.indexOf(handler)
    Severity: Major
    Found in src/xrm-mock/controls/lookupcontrol/lookupcontrol.mock.ts and 1 other location - About 2 hrs to fix
    src/xrm-mock/controls/lookupcontrol/lookupcontrol.mock.ts on lines 108..114

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

    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

      constructor(components: IRelationshipComponents) {
        this.attributeName = components.attributeName;
        this.name = components.name;
        this.navigationPropertyName = components.navigationPropertyName;
        this.relationshipType = components.relationshipType;
    Severity: Major
    Found in src/xrm-mock/navigation/relationship/relationship.mock.ts and 2 other locations - About 2 hrs to fix
    src/xrm-mock/device/captureimageoptions/captureimageoptions.mock.ts on lines 8..14
    src/xrm-mock/navigation/confirmstrings/confirmstrings.mock.ts on lines 8..14

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

    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

      constructor(components: ICaptureImageOptionsComponents) {
        this.allowEdit = components.allowEdit;
        this.height = components.height;
        this.preferFrontCamera = components.preferFrontCamera;
        this.quality = components.quality;
    src/xrm-mock/navigation/confirmstrings/confirmstrings.mock.ts on lines 8..14
    src/xrm-mock/navigation/relationship/relationship.mock.ts on lines 8..14

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

    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

      constructor(components: IConfirmStringsComponents) {
        this.cancelButtonLabel = components.cancelButtonLabel;
        this.confirmButtonLabel = components.confirmButtonLabel;
        this.subtitle = components.subtitle;
        this.title = components.title;
    src/xrm-mock/device/captureimageoptions/captureimageoptions.mock.ts on lines 8..14
    src/xrm-mock/navigation/relationship/relationship.mock.ts on lines 8..14

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

    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

    ContextMock has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class ContextMock implements Xrm.GlobalContext {
        public advancedConfigSetting: {[index in "MaxChildIncidentNumber" | "MaxIncidentMergeNumber"]: number };
        public client: Xrm.ClientContext;
        public clientUrl: string;
        public currentAppName: string;
    Severity: Minor
    Found in src/xrm-mock/globalcontext/context.mock.ts - About 2 hrs to fix

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

        constructor(components?: ISaveEventContextComponents) {
          if (components?.saveMode
            && components?.eventArgs){
            throw new Error("SaveEventContextMock.constructor: saveMode and eventArgs cannot both be defined");
          }
      src/xrm-mock/events/saveeventcontextasync.mock.ts on lines 8..17

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

      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

        constructor(components?: ISaveEventContextAsyncComponents) {
          if (components?.saveMode
            && components?.eventArgs){
            throw new Error("SaveEventContextAsyncMock.constructor: saveMode and eventArgs cannot both be defined");
          }
      Severity: Major
      Found in src/xrm-mock/events/saveeventcontextasync.mock.ts and 1 other location - About 2 hrs to fix
      src/xrm-mock/events/saveeventcontext/saveeventcontext.mock.ts on lines 5..14

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

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

        constructor(components: IEntityMetadataComponents) {
          this.ActivityTypeMask = components.ActivityTypeMask;
          this.Attributes = components.Attributes;
          this.AutoRouteToOwnerQueue = components.AutoRouteToOwnerQueue;
          this.CanEnableSyncToExternalSearchIndex = components.CanEnableSyncToExternalSearchIndex;
      Severity: Major
      Found in src/xrm-mock/metadata/entitymetadata/entitymetadata.mock.ts - About 2 hrs to fix

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

            constructor(formid?: string, navbar?: Xrm.Url.NavBarDisplay, cmdbar?: Xrm.Url.CmdBarDisplay) {
                this.formid = formid;
                this.navbar = navbar;
                this.cmdbar = cmdbar;
            }
        src/xrm-mock/controls/navigationitem/navigationitem.mock.ts on lines 6..10

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

        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

          constructor(id: string, standardElement: Xrm.Controls.UiStandardElement, focusable: Xrm.Controls.UiFocusable) {
            this.id = id;
            this.standardElement = standardElement;
            this.focusable = focusable;
          }
        Severity: Major
        Found in src/xrm-mock/controls/navigationitem/navigationitem.mock.ts and 1 other location - About 2 hrs to fix
        src/xrm-mock/utility/formopenparameters/formopenparameters.mock.ts on lines 7..11

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

        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

          constructor(components: IProcessComponents) {
              this.id = components.id;
              this.name = components.name;
              this.stages = components.stages;
              this.rendered = components.rendered;
        Severity: Major
        Found in src/xrm-mock/processflow/process/process.mock.ts and 2 other locations - About 2 hrs to fix
        src/xrm-mock/controls/addcontrolnotificationoptions/addcontrolnotificationoptions.mock.ts on lines 7..12
        src/xrm-mock/controls/formitem/formitem.mock.ts on lines 7..12

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

        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

          constructor(components: IAddControlNotificationOptionsComponents) {
            this.actions = components.actions;
            this.messages = components.messages;
            this.notificationLevel = components.notificationLevel;
            this.uniqueId = components.uniqueId;
        src/xrm-mock/controls/formitem/formitem.mock.ts on lines 7..12
        src/xrm-mock/processflow/process/process.mock.ts on lines 7..12

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

        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

        export class OfflineOperationSuccessCallbackObjectMock implements Xrm.Async.OfflineOperationSuccessCallbackObject {
            public id: string;
            public logicalName: string;
        
            constructor(id: string, logicalName: string) {
        src/xrm-mock/navigation/alertstrings/alertstrings.mock.ts on lines 1..9

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

        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

        export class AlertStringsMock implements Xrm.Navigation.AlertStrings {
          public confirmButtonLabel?: string;
          public text: string;
        
          constructor(text: string, confirmButtonLabel?: string) {
        Severity: Major
        Found in src/xrm-mock/navigation/alertstrings/alertstrings.mock.ts and 1 other location - About 2 hrs to fix
        src/xrm-mock/async/offlineoperationsuccesscallbackobject/offlineoperationsuccesscallbackobject.mock.ts on lines 1..9

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

        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

          constructor(components: IFormItemComponents) {
             this.id = components.id;
             this.label = components.label;
             this.formType = components.formType;
             this.currentItem = components.currentItem;
        Severity: Major
        Found in src/xrm-mock/controls/formitem/formitem.mock.ts and 2 other locations - About 2 hrs to fix
        src/xrm-mock/controls/addcontrolnotificationoptions/addcontrolnotificationoptions.mock.ts on lines 7..12
        src/xrm-mock/processflow/process/process.mock.ts on lines 7..12

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

        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