src/app/lore/component/timeline/block.component.ts
File block.component.ts
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Enclosing, Node } from '@alexaegis/avl';
import {
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Function panNode
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function panNode
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
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);
- Read upRead up
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
Open
@Component({
selector: 'app-block',
templateUrl: './block.component.html',
styleUrls: ['./block.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
Function remove
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public remove(node: Node<UnixWrapper, ActorDelta>, isDisabled: boolean): void {
if (!isDisabled) {
if (!this.isAtMostOneLeft) {
this.dialog
.open(ConfirmComponent)
Function pan
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@HostListener('panstart', ['$event'])
@HostListener('panleft', ['$event'])
@HostListener('panright', ['$event'])
@HostListener('panup', ['$event'])
@HostListener('pandown', ['$event'])
Function surroundAndSpeed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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>;
- Read upRead up
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
Open
// const conflictingNode = this.actor._states.get(this._w); // TODO: It finds itself
- Exclude checks