AlexAegis/loreplotter

View on GitHub

Showing 128 of 146 total issues

Function PEhandler has a Cognitive Complexity of 11 (exceeds 5 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

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

            .subscribe(c => {
                for (let i = Math.min(this.c, c); i < Math.max(this.c, c); i++) {
                    if (c < this.c) {
                        try {
                            this.viewContainer.detach();
Severity: Minor
Found in src/app/directive/repeat.directive.ts - About 1 hr to fix

    Function onTouchMove has 29 lines of code (exceeds 25 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 1 hr to fix

      Function ngOnInit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public ngOnInit(): void {
              this.teardown = this.onResizeSubject.subscribe($event => {
                  const w = ($event as any).target.innerWidth;
                  const h = ($event as any).target.innerHeight;
                  this.storeFacade.setMediaLarge(w / h >= 1.8); // Standard 16/9 ratio is 1.77 repeating.
      Severity: Minor
      Found in src/app/lore/component/element/sidebar.component.ts - About 1 hr to fix

        Function shift has a Cognitive Complexity of 10 (exceeds 5 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/timeline.component.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 _onTouchMove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                return function _onTouchMove(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 tweenOperation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              return function tweenOperation(source: Observable<Tweenable<T>>): Observable<T> {
                  const innerSubject = new BehaviorSubject<T>(undefined);
                  let lastTween: Tween;
                  if (pingpongAfterFinish) {
                      pingpongInterrupt = true;
          Severity: Minor
          Found in src/app/operator/tween-map.operator.ts - About 1 hr to fix

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

              Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(config) {
                  config.set({
                      basePath: '',
                      frameworks: ['jasmine', '@angular-devkit/build-angular'],
                      plugins: plugins,
              Severity: Minor
              Found in src/karma.conf.js - About 1 hr to fix

                Function newProperties has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        newProperties: this.formBuilder.array([], (ctrl: FormArray) => {
                            const dups = new Map<string, Array<FormGroup>>();
                            if (this.properties) {
                                this.properties.controls.forEach((propctrl: FormGroup) => {
                                    const key = (propctrl as FormGroup).controls['key'].value;
                Severity: Minor
                Found in src/app/lore/component/dialog/actor-form.component.ts - About 1 hr to fix

                  Function downloadTextures has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

                      Function click has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 surroundAndSpeed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      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>;
                      Severity: Minor
                      Found in src/app/lore/component/timeline/block.component.ts - About 45 mins 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 8 (exceeds 5 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 45 mins 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

                      Avoid deeply nested control flow statements.
                      Open

                                                              if (value) {
                                                                  if (value === FORGET_TOKEN) {
                                                                      if (!prop.value.startsWith(FORGET_TOKEN)) {
                                                                          prop.value = `${FORGET_TOKEN}.${prop.value}`;
                                                                      }
                      Severity: Major
                      Found in src/app/service/actor.service.ts - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                if (value !== undefined && prop.nextAppearance === undefined) {
                                                                    prop.nextValue = value;
                                                                    prop.nextAppearance = node;
                                                                }
                        Severity: Major
                        Found in src/app/service/actor.service.ts - About 45 mins to fix

                          Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static create(formBuilder: FormBuilder): FormGroup {
                                  return formBuilder.group({
                                      key: [
                                          '',
                                          [
                          Severity: Minor
                          Found in src/app/lore/component/dialog/form-entry.component.ts - About 35 mins 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 ngOnInit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public ngOnInit(): void {
                                  this.teardown = this.onResizeSubject.subscribe($event => {
                                      const w = ($event as any).target.innerWidth;
                                      const h = ($event as any).target.innerHeight;
                                      this.storeFacade.setMediaLarge(w / h >= 1.8); // Standard 16/9 ratio is 1.77 repeating.
                          Severity: Minor
                          Found in src/app/lore/component/element/sidebar.component.ts - About 35 mins 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 serializeActor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function serializeActor(actor: Actor): Actor {
                              if (actor !== undefined && actor !== null) {
                                  if (actor._states) {
                                      for (const node of actor._states.nodes()) {
                                          node.key.unix = Math.floor(node.key.unix);
                          Severity: Minor
                          Found in src/app/model/data/actor.class.ts - About 35 mins 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