AlexAegis/loreplotter

View on GitHub
src/app/lore/engine/object/actor-object.class.ts

Summary

Maintainability
D
2 days
Test Coverage

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 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 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 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 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

          TODO found
          Open

                  this.requestedDistance = this.requestedAngle * globe.radius; // TODO: Ditch

          TODO found
          Open

                  // Quaternion stuff TODO: Ditch

          TODO found
          Open

                  this.nearestQuaternion = preLookHelper.quaternion.clone(); // TODO: Ditch

          TODO found
          Open

                  preLookHelper.lookAt(this.nearestAllowedPosition); // TODO: Ditch

          TODO found
          Open

              ]; // TODO: Transition from q to vector3

          TODO found
          Open

                   * TODO: The first/last thing is switched, fix it in the AVL repo

          There are no issues that match your filters.

          Category
          Status