AlexAegis/loreplotter

View on GitHub

Showing 128 of 146 total issues

LoreEffects has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

@Injectable()
export class LoreEffects {
    public constructor(
        private actions$: Actions<FeatureActions>,
        private store: Store<FeatureState>,
Severity: Minor
Found in src/app/lore/store/effects/lore.effects.ts - About 2 hrs to fix

    Function importDatabase has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public importDatabase(): void {
            this.databaseService.database$
                .pipe(
                    take(1),
                    switchMap(db =>
    Severity: Major
    Found in src/app/lore/component/dialog/export.component.ts - About 2 hrs to fix

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

          public pan(coord: Vector2, velocity: Vector2, button: number, start: boolean, end: boolean) {
              // this.control.enabled = this.interactionMode === 'move';
              this.raycaster.setFromCamera(coord, this.stage.camera);
              const intersections = this.raycaster.intersectObject(this.globe, true);
              const intersectionsFiltered = intersections.filter(i => i.object.type === 'Globe' || i.object.type === 'Point'); // Ignoring arcs
      Severity: Major
      Found in src/app/lore/engine/engine.service.ts - About 2 hrs to fix

        Function actorStateMapper has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public static actorStateMapper(actor: RxDocument<Actor> | Actor): RxDocument<Actor> | Actor {
                if (actor.states) {
                    let parsedStates = actor.states;
                    if (environment.production) {
                        parsedStates = parsedStates.replace(
        Severity: Minor
        Found in src/app/service/database.service.ts - About 2 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

        Function onTouchMove has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            static onTouchMove(scope: OrbitControls) {
                return function _onTouchMove(event) {
                    if (scope.enabled === false) {
                        return;
                    }
        Severity: Minor
        Found in src/app/lore/engine/control/orbit-control.class.ts - About 2 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

        Function onKeyDown has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @HostListener('window:keydown', ['$event'])
            public onKeyDown($event: KeyboardEvent): void {
                if (document.activeElement.tagName !== 'INPUT') {
                    switch ($event.code) {
                        case 'Space':
        Severity: Major
        Found in src/app/lore/lore.component.ts - About 2 hrs to fix

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

                public constructor(
                    private zoomSubject: BehaviorSubject<number>,
                    public radius: number = 1,
                    private storeFacade: StoreFacade
                ) {
            Severity: Major
            Found in src/app/lore/engine/object/globe.class.ts - About 2 hrs to fix

              Function loreReducer has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function loreReducer(state: LoreState = initialLoreState, action: LoreActions): LoreState {
                  switch (action.type) {
                      // initial load
                      case loadLores.type: {
                          return { ...state, loading: true };
              Severity: Major
              Found in src/app/lore/store/reducers/lore.reducer.ts - About 2 hrs to fix

                Function removeKeys has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                export function removeKeys<T = {}>(obj: T, keys: Array<string>): T {
                    let index;
                    for (const prop in obj) {
                        // important check that this is objects own property
                        // not from prototype prop inherited
                Severity: Minor
                Found in src/app/function/key-remover.function.ts - About 2 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

                Function createScene has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public createScene(canvas: HTMLCanvasElement): void {
                        this.renderer = new WebGLRenderer({
                            canvas: canvas,
                            alpha: false,
                            logarithmicDepthBuffer: true,
                Severity: Major
                Found in src/app/lore/engine/engine.service.ts - About 2 hrs to fix

                  Function loadDefaultEarth has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public loadDefaultEarth(): void {
                          this.teardown = this.dialog
                              .open(ConfirmComponent, {
                                  data: {
                                      title: 'Warning!',
                  Severity: Minor
                  Found in src/app/lore/component/dialog/lore-form.component.ts - About 2 hrs to fix

                    Function constructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public constructor(private templateRef: TemplateRef<any>, private viewContainer: ViewContainerRef) {
                            super();
                            this.teardown = this.audit
                                .pipe(
                                    throttleTime(1000 / 60),
                    Severity: Minor
                    Found in src/app/directive/repeat.directive.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

                    Function calculateIntersection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public calculateIntersection(globe: Globe, preLookHelper: Group, isDebugMode: boolean) {
                            if (this.left.valid && this.right.valid) {
                                this.normal
                                    .copy(this.left.position)
                                    .cross(this.right.position)
                    Severity: Minor
                    Found in src/app/lore/engine/object/actor-object.class.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

                    Function onMouseDown has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        static onMouseDown(scope: OrbitControls) {
                            return function _onMouseDown(event) {
                                if (scope.enabled === false) {
                                    return;
                                }
                    Severity: Minor
                    Found in src/app/lore/engine/control/orbit-control.class.ts - About 1 hr to fix

                      Function constructor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public constructor(
                              public dialogRef: MatDialogRef<ActorFormComponent>,
                              @Inject(MAT_DIALOG_DATA) public originalData: Accumulator,
                              private formBuilder: FormBuilder,
                              private actorService: ActorService,
                      Severity: Minor
                      Found in src/app/lore/component/dialog/actor-form.component.ts - About 1 hr 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 _onMouseDown has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  return function _onMouseDown(event) {
                                      if (scope.enabled === false) {
                                          return;
                                      }
                          
                          
                          Severity: Minor
                          Found in src/app/lore/engine/control/orbit-control.class.ts - About 1 hr to fix

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

                                constructor(private storeFacade: StoreFacade, private databaseService: DatabaseService) {
                                    this.selection$.subscribe();
                                    this.hover$.subscribe();
                            
                                    this.storeFacade.isDebugMode$.subscribe(isDebugMode => {
                            Severity: Minor
                            Found in src/app/lore/engine/engine.service.ts - About 1 hr to fix

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

                                  public static actorStateMapper(actor: RxDocument<Actor> | Actor): RxDocument<Actor> | Actor {
                                      if (actor.states) {
                                          let parsedStates = actor.states;
                                          if (environment.production) {
                                              parsedStates = parsedStates.replace(
                              Severity: Minor
                              Found in src/app/service/database.service.ts - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language