AlexAegis/loreplotter

View on GitHub

Showing 146 of 146 total issues

Function onPanStart has 258 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public onPanStart(e: any): void {
        this.positionAtStart = this.parent.quaternion.clone();
        this.parent.userData.override = true; // Switched off in the LoreService
        combineLatest([
            this.storeFacade.isDebugMode$,
Severity: Major
Found in src/app/lore/engine/object/actor-object.class.ts - About 1 day to fix

    File orbit-control.class.ts has 576 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Spherical, Vector2, Vector3 } from 'three';
    
    const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
    
    // This set of controls performs orbiting, dollying (zooming), and panning.
    Severity: Major
    Found in src/app/lore/engine/control/orbit-control.class.ts - About 1 day to fix

      File engine.service.ts has 537 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Injectable } from '@angular/core';
      import { denormalize } from '@app/function';
      import { Actor, Lore, Planet, Vector3Serializable } from '@app/model/data';
      
      import { tweenMap } from '@app/operator/tween-map.operator';
      Severity: Major
      Found in src/app/lore/engine/engine.service.ts - About 1 day to fix

        File actor-object.class.ts has 537 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Enclosing, Node } from '@alexaegis/avl';
        import { arcIntersection } from '@app/function/arc-intersect.function';
        import { intersection } from '@app/function/intersection.function';
        import { Actor, ActorDelta, UnixWrapper } from '@app/model/data';
        import { Accumulator, ActorService, LoreService } from '@app/service';
        Severity: Major
        Found in src/app/lore/engine/object/actor-object.class.ts - About 1 day to fix

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

              constructor(
                  private engineService: EngineService,
                  private databaseService: DatabaseService,
                  private storeFacade: StoreFacade,
                  private actorService: ActorService
          Severity: Major
          Found in src/app/service/lore.service.ts - About 1 day to fix

            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

              OrbitControls has 51 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class OrbitControls extends EventDispatcher {
                  static STATE = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4 };
              
                  constructor(public object: PerspectiveCamera | OrthographicCamera, private domElement: HTMLCanvasElement) {
                      super();
              Severity: Major
              Found in src/app/lore/engine/control/orbit-control.class.ts - About 7 hrs to fix

                StoreFacade has 43 functions (exceeds 20 allowed). Consider refactoring.
                Open

                @Injectable()
                export class StoreFacade {
                    // Project
                    public lores$ = this.store$.pipe(select(loreQuery.getLores));
                    public selectedLore$ = this.store$.pipe(
                Severity: Minor
                Found in src/app/lore/store/store-facade.service.ts - About 5 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

                    File actor.service.ts has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { Node } from '@alexaegis/avl';
                    import { Injectable } from '@angular/core';
                    import { refreshBlockOfActor } from '@app/function';
                    import { enclosingProgress } from '@app/function/enclosing-progress.function';
                    import { EngineService } from '@app/lore/engine/engine.service';
                    Severity: Minor
                    Found in src/app/service/actor.service.ts - About 4 hrs to fix

                      EngineService has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      @Injectable()
                      export class EngineService {
                          /**
                           * These subscriptions are for ensuring the side effects are happening always, even when there are no other subscirbers end the listeners
                           * (Since they are shared, side effects will only happen once)
                      Severity: Minor
                      Found in src/app/lore/engine/engine.service.ts - About 4 hrs to fix

                        Function onMouseDown has a Cognitive Complexity of 27 (exceeds 5 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 3 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 sceneReducer has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function sceneReducer(state: SceneState = initialSceneState, action: SceneActions): SceneState {
                            switch (action.type) {
                                case setPlaySpeed.type: {
                                    return {
                                        ...state,
                        Severity: Major
                        Found in src/app/lore/store/reducers/scene.reducer.ts - About 3 hrs to fix

                          Function pan has a Cognitive Complexity of 26 (exceeds 5 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: Minor
                          Found in src/app/lore/engine/engine.service.ts - About 3 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

                            File scene.reducer.ts has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { toUnit } from '@app/function';
                            import { DeltaProperty, OverridableProperty } from '@app/model';
                            import {
                                bakeCursorOverride,
                                bakeFrame,
                            Severity: Minor
                            Found in src/app/lore/store/reducers/scene.reducer.ts - About 3 hrs to fix

                              Function frameReducer has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function frameReducer(frame: FrameState, action: SceneActions): FrameState {
                                  switch (action.type) {
                                      case setFrameTo.type: {
                                          const start = action.payload.start || frame.start.base;
                                          const end = action.payload.end || frame.end.base;
                              Severity: Major
                              Found in src/app/lore/store/reducers/scene.reducer.ts - About 3 hrs to fix

                                File lore.service.ts has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { Enclosing, Node } from '@alexaegis/avl';
                                import { Offset } from '@angular-skyhook/core';
                                import { Injectable } from '@angular/core';
                                import { BaseDirective } from '@app/component/base-component.class';
                                import { normalizeFromWindow } from '@app/function';
                                Severity: Minor
                                Found in src/app/service/lore.service.ts - About 2 hrs to fix

                                  Function initializePostprocessing has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private initializePostprocessing(): void {
                                          // PostProcessing
                                  
                                          this.composer = new EffectComposer(this.renderer, {
                                              stencilBuffer: true
                                  Severity: Major
                                  Found in src/app/lore/engine/engine.service.ts - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language