uu-cubitt/events

View on GitHub

Showing 38 of 38 total issues

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

export class ConnectorPropertyDeletedEvent extends PropertyDeletedEvent {
    /**
     * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
     * @param version The new current version number.
     * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
Severity: Major
Found in src/events/ConnectorPropertyDeletedEvent.ts and 3 other locations - About 2 hrs to fix
src/events/EdgePropertyDeletedEvent.ts on lines 9..32
src/events/ModelPropertyDeletedEvent.ts on lines 9..32
src/events/NodePropertyDeletedEvent.ts on lines 9..32

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

export class EdgePropertyDeletedEvent extends PropertyDeletedEvent {
    /**
     * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
     * @param version The new current version number.
     * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
Severity: Major
Found in src/events/EdgePropertyDeletedEvent.ts and 3 other locations - About 2 hrs to fix
src/events/ConnectorPropertyDeletedEvent.ts on lines 9..32
src/events/ModelPropertyDeletedEvent.ts on lines 9..32
src/events/NodePropertyDeletedEvent.ts on lines 9..32

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

export class ModelPropertyDeletedEvent extends PropertyDeletedEvent {
    /**
     * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
     * @param version The new current version number.
     * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
Severity: Major
Found in src/events/ModelPropertyDeletedEvent.ts and 3 other locations - About 2 hrs to fix
src/events/ConnectorPropertyDeletedEvent.ts on lines 9..32
src/events/EdgePropertyDeletedEvent.ts on lines 9..32
src/events/NodePropertyDeletedEvent.ts on lines 9..32

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

export class NodePropertyDeletedEvent extends PropertyDeletedEvent {
    /**
     * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
     * @param version The new current version number.
     * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
Severity: Major
Found in src/events/NodePropertyDeletedEvent.ts and 3 other locations - About 2 hrs to fix
src/events/ConnectorPropertyDeletedEvent.ts on lines 9..32
src/events/EdgePropertyDeletedEvent.ts on lines 9..32
src/events/ModelPropertyDeletedEvent.ts on lines 9..32

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

Function parse has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static parse(jsonObject: Object): Event {
        if (typeof(jsonObject) === "undefined" || jsonObject === null) {
            throw new Error("EVENT ERROR: Empty object cannot be parsed.");
        }

Severity: Minor
Found in src/EventFactory.ts - About 1 hr to fix

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

    export class EdgeDeletedEvent extends DeletedEvent {
        /**
         * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
         * @param version The new current version number.
         * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
    Severity: Major
    Found in src/events/EdgeDeletedEvent.ts and 3 other locations - About 1 hr to fix
    src/events/ConnectorDeletedEvent.ts on lines 9..29
    src/events/ModelDeletedEvent.ts on lines 9..29
    src/events/NodeDeletedEvent.ts on lines 9..29

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

    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 validateObject has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        protected static validateObject(object: Object, keysWithType: Common.Dictionary<ValidationType>): void {
            for (let key in keysWithType) {
                let type: ValidationType = keysWithType[key];
                let val: any = object[key];
                if (typeof(val) === "undefined") {
    Severity: Minor
    Found in src/EventFactory.ts - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    export class NodeDeletedEvent extends DeletedEvent {
        /**
         * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
         * @param version The new current version number.
         * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
    Severity: Major
    Found in src/events/NodeDeletedEvent.ts and 3 other locations - About 1 hr to fix
    src/events/ConnectorDeletedEvent.ts on lines 9..29
    src/events/EdgeDeletedEvent.ts on lines 9..29
    src/events/ModelDeletedEvent.ts on lines 9..29

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

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

    export class ModelDeletedEvent extends DeletedEvent {
    /**
         * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
         * @param version The new current version number.
         * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
    Severity: Major
    Found in src/events/ModelDeletedEvent.ts and 3 other locations - About 1 hr to fix
    src/events/ConnectorDeletedEvent.ts on lines 9..29
    src/events/EdgeDeletedEvent.ts on lines 9..29
    src/events/NodeDeletedEvent.ts on lines 9..29

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

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

    export class ConnectorDeletedEvent extends DeletedEvent {
        /**
         * @param sourceId The RFC4122 v4 compliant ID of the command that caused this event.
         * @param version The new current version number.
         * @param timestamp The timestamp for the moment this event was created in milliseconds elapsed since 1 January 1970 00:00:00 UTC.
    Severity: Major
    Found in src/events/ConnectorDeletedEvent.ts and 3 other locations - About 1 hr to fix
    src/events/EdgeDeletedEvent.ts on lines 9..29
    src/events/ModelDeletedEvent.ts on lines 9..29
    src/events/NodeDeletedEvent.ts on lines 9..29

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

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

        protected static getEventType(type: string): EventType {
            switch (type) {
                case "ConnectorAddedEvent":
                    return EventType.ConnectorAdded;
                case "EdgeAddedEvent":
    Severity: Minor
    Found in src/EventFactory.ts - About 1 hr to fix

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

          protected static validateObject(object: Object, keysWithType: Common.Dictionary<ValidationType>): void {
              for (let key in keysWithType) {
                  let type: ValidationType = keysWithType[key];
                  let val: any = object[key];
                  if (typeof(val) === "undefined") {
      Severity: Minor
      Found in src/EventFactory.ts - About 1 hr to fix

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

            constructor(
                sourceId: Common.Guid,
                version: number,
                type: EventType,
                timestamp: number,
        Severity: Minor
        Found in src/events/AddedEvent.ts and 1 other location - About 35 mins to fix
        src/events/PropertySetEvent.ts on lines 34..51

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

        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(
                sourceId: Common.Guid,
                version: number,
                type: EventType,
                timestamp: number,
        Severity: Minor
        Found in src/events/PropertySetEvent.ts and 1 other location - About 35 mins to fix
        src/events/AddedEvent.ts on lines 34..51

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

        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

        Line length
        Open

        Events exist for all basic graph operations, such as addition and removal of nodes, edges, models and connectors.
        Severity: Info
        Found in readme.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Line length
        Open

        For more information about the CQRS implementation of the Cubitt framework, please take a look [here](https://uu-cubitt.github.io/).
        Severity: Info
        Found in readme.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Line length
        Open

        - Changed all event constructors to not require a command to allow for parsing from JSON.
        Severity: Info
        Found in changelog.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Line length
        Open

        This library contains the events raised by the command handler after editing the Cubitt Graph through commands.
        Severity: Info
        Found in readme.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Severity
        Category
        Status
        Source
        Language