AlexAegis/loreplotter

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

Summary

Maintainability
B
4 hrs
Test Coverage

TimelineComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

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

    Function ngOnInit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public ngOnInit(): void {
            this.teardown = this.frameShifter
                .pipe(withLatestFrom(this.storeFacade.frame$, this.loreService.containerWidth))
                .subscribe(([shift, frame, containerWidth]) => {
                    if (shift !== undefined) {
    Severity: Minor
    Found in src/app/lore/component/timeline/timeline.component.ts - About 1 hr to fix

      Function shift has a Cognitive Complexity of 10 (exceeds 5 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/timeline.component.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

      TODO found
      Open

           * TODO: Hammer pinch support

      TODO found
      Open

                      // TODO: I don't know why but it's shifted by exactly two hours

      There are no issues that match your filters.

      Category
      Status