AlexAegis/loreplotter

View on GitHub

Showing 146 of 146 total issues

Function update has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    update() {
        const position = this.object.position;

        this._updateOffset.copy(position).sub(this.target);

Severity: Minor
Found in src/app/lore/engine/control/orbit-control.class.ts - About 1 hr to fix

    Function onMouseMove has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        static onMouseMove(scope: OrbitControls) {
            return function _onMouseMove(event) {
                if (scope.enabled === false) {
                    return;
                }
    Severity: Minor
    Found in src/app/lore/engine/control/orbit-control.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 onTouchStart has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        static onTouchStart(scope: OrbitControls) {
            return function _onTouchStart(event) {
                if (scope.enabled === false) {
                    return;
                }
    Severity: Minor
    Found in src/app/lore/engine/control/orbit-control.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 constructor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        constructor(
            private engineService: EngineService,
            private databaseService: DatabaseService,
            private storeFacade: StoreFacade,
            private actorService: ActorService
    Severity: Minor
    Found in src/app/service/lore.service.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 finiteProgress has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function finiteProgress<T>(
        onStart?: (start: { total: number; observables: Array<Observable<T>> }) => void,
        onProgress?: (progress: { result: T; done: number; total: number; index: number }) => void,
        onFinish?: () => void
    ): OperatorFunction<Observable<T>, T> {
    Severity: Minor
    Found in src/app/operator/finite-progress.operator.ts - About 1 hr to fix

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

          public constructor(
              public actor: RxDocument<Actor>,
              private storeFacade: StoreFacade,
              private loreService: LoreService,
              private actorService: ActorService,
      Severity: Minor
      Found in src/app/lore/engine/object/actor-object.class.ts - About 1 hr to fix

        Function constructor has 38 lines of code (exceeds 25 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

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

              return function progressOperation(source: Observable<Observable<T>>): Observable<T> {
                  return source.pipe(
                      map(observable => ({ total: 0, observables: [observable] })),
                      reduce(
                          (acc, next) => {
          Severity: Minor
          Found in src/app/operator/finite-progress.operator.ts - About 1 hr 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 actorPositionAt has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public actorPositionAt(actor: RxDocument<Actor>, unix: number): Vector3Serializable {
                      let finalPosition: Vector3Serializable;
                      this._w.unix = unix;
                      const enclosing = actor._states.enclosingNodes(this._w);
                      if (enclosing.first === undefined || enclosing.last === undefined) {
              Severity: Minor
              Found in src/app/service/actor.service.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 35 lines of code (exceeds 25 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

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

                  export function intersection(c1: Circle, c2: Circle, radius: number): Array<Vector3> {
                      const intersections: Array<Vector3> = [];
                  
                      // project to (x,y,z) with unit radius
                      const x1: Vector3 = c1.center.clone().normalize();
                  Severity: Minor
                  Found in src/app/function/intersection.function.ts - About 1 hr to fix

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

                    export function infiniteProgress<T>(
                        onEnter?: (enter: { index: number; count: number; observable: Observable<T> }) => void,
                        onProgress?: (progress: { result: T; done: number; total: number; index: number }) => void,
                        onFinish?: () => void
                    ): OperatorFunction<Observable<T>, T> {
                    Severity: Minor
                    Found in src/app/operator/infinite-progress.operator.ts - About 1 hr to fix

                      Function click has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public click(coord: Vector2, shift: boolean) {
                              this.control.enabled = true;
                              this.raycaster.setFromCamera(coord, this.stage.camera);
                              const intersection = this.raycaster
                                  .intersectObject(this.globe, true)
                      Severity: Minor
                      Found in src/app/lore/engine/engine.service.ts - About 1 hr to fix

                        Function PEhandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            handler: function PEhandler(ev) {
                                const store = this.store;
                                let removePointer = false;
                        
                                const eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
                        Severity: Minor
                        Found in src/polyfill/hammer-extended-mouse-events.polyfill.ts - About 1 hr to fix

                          Function actorPositionAt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public actorPositionAt(actor: RxDocument<Actor>, unix: number): Vector3Serializable {
                                  let finalPosition: Vector3Serializable;
                                  this._w.unix = unix;
                                  const enclosing = actor._states.enclosingNodes(this._w);
                                  if (enclosing.first === undefined || enclosing.last === undefined) {
                          Severity: Minor
                          Found in src/app/service/actor.service.ts - About 1 hr to fix

                            Function progressOperation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                return function progressOperation(source: Observable<Observable<T>>): Observable<T> {
                                    return source.pipe(
                                        mergeScan((acc, next) => of((acc.index = acc.count++) !== undefined && (acc.observable = next) && acc), {
                                            index: 0,
                                            count: 0,
                            Severity: Minor
                            Found in src/app/operator/infinite-progress.operator.ts - About 1 hr to fix

                              Function inArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function inArray(src, find, findByKey) {
                                  if (src.indexOf && !findByKey) {
                                      return src.indexOf(find);
                                  } else {
                                      let i = 0;
                              Severity: Minor
                              Found in src/polyfill/hammer-extended-mouse-events.polyfill.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 frameReducer has a Cognitive Complexity of 11 (exceeds 5 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: Minor
                              Found in src/app/lore/store/reducers/scene.reducer.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

                              Severity
                              Category
                              Status
                              Source
                              Language