AlexAegis/loreplotter

View on GitHub
src/app/lore/component/timeline/block.component.ts

Summary

Maintainability
D
2 days
Test Coverage

File block.component.ts has 470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Enclosing, Node } from '@alexaegis/avl';
import {
    AfterViewInit,
    ChangeDetectionStrategy,
    ChangeDetectorRef,
Severity: Minor
Found in src/app/lore/component/timeline/block.component.ts - About 7 hrs to fix

    Function panNode has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public panNode($event: any, node: Node<UnixWrapper, ActorDelta>): void {
            $event.stopPropagation();
            if ($event.type === 'panstart') {
                this.isPanning = true;
                this._originalUnixesForPan.set(node, node.key.unix);
    Severity: Major
    Found in src/app/lore/component/timeline/block.component.ts - About 4 hrs to fix

      Function panNode has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          public panNode($event: any, node: Node<UnixWrapper, ActorDelta>): void {
              $event.stopPropagation();
              if ($event.type === 'panstart') {
                  this.isPanning = true;
                  this._originalUnixesForPan.set(node, node.key.unix);
      Severity: Minor
      Found in src/app/lore/component/timeline/block.component.ts - About 4 hrs 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

      BlockComponent has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Component({
          selector: 'app-block',
          templateUrl: './block.component.html',
          styleUrls: ['./block.component.scss'],
          changeDetection: ChangeDetectionStrategy.OnPush
      Severity: Minor
      Found in src/app/lore/component/timeline/block.component.ts - About 3 hrs to fix

        Function remove has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public remove(node: Node<UnixWrapper, ActorDelta>, isDisabled: boolean): void {
                if (!isDisabled) {
                    if (!this.isAtMostOneLeft) {
                        this.dialog
                            .open(ConfirmComponent)
        Severity: Minor
        Found in src/app/lore/component/timeline/block.component.ts - About 1 hr to fix

          Function pan has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @HostListener('panstart', ['$event'])
              @HostListener('panleft', ['$event'])
              @HostListener('panright', ['$event'])
              @HostListener('panup', ['$event'])
              @HostListener('pandown', ['$event'])
          Severity: Minor
          Found in src/app/lore/component/timeline/block.component.ts - About 1 hr to fix

            Function surroundAndSpeed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public surroundAndSpeed(
                    node: Node<UnixWrapper, ActorDelta>
                ): { prev: Node<UnixWrapper, ActorDelta>; next: Node<UnixWrapper, ActorDelta>; speed: number } {
                    let prevNodeNow: Node<UnixWrapper, ActorDelta>;
                    let nextNodeNow: Node<UnixWrapper, ActorDelta>;
            Severity: Minor
            Found in src/app/lore/component/timeline/block.component.ts - About 45 mins 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

            TODO found
            Open

                    // const conflictingNode = this.actor._states.get(this._w); // TODO: It finds itself

            There are no issues that match your filters.

            Category
            Status