aurelia/aurelia

View on GitHub
packages/platform/src/index.ts

Summary

Maintainability
F
1 wk
Test Coverage
B
81%

File index.ts has 587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const tsPending = 'pending' as const;
const tsRunning = 'running' as const;
const tsCompleted = 'completed' as const;
const tsCanceled = 'canceled' as const;
export type TaskStatus = typeof tsPending | typeof tsRunning | typeof tsCompleted | typeof tsCanceled;
Severity: Major
Found in packages/platform/src/index.ts - About 1 day to fix

    Function flush has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

      public flush(time: number = this._now()): void {
        if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'flush'); }
    
        this._flushRequested = false;
        this._lastFlush = time;
    Severity: Minor
    Found in packages/platform/src/index.ts - About 5 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 run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

      public run(time: number = this.taskQueue.platform.performanceNow()): void {
        if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'run'); }
    
        if (this._status !== tsPending) {
          if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'run error'); }
    Severity: Minor
    Found in packages/platform/src/index.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 run has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public run(time: number = this.taskQueue.platform.performanceNow()): void {
        if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'run'); }
    
        if (this._status !== tsPending) {
          if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'run error'); }
    Severity: Major
    Found in packages/platform/src/index.ts - About 3 hrs to fix

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

        public queueTask<T = any>(callback: TaskCallback<T>, opts?: QueueTaskOptions): Task<T> {
          if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'queueTask'); }
      
          const { delay, preempt, persistent, reusable, suspend } = { ...defaultQueueTaskOptions, ...opts };
      
      
      Severity: Minor
      Found in packages/platform/src/index.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 flush has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public flush(time: number = this._now()): void {
          if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'flush'); }
      
          this._flushRequested = false;
          this._lastFlush = time;
      Severity: Minor
      Found in packages/platform/src/index.ts - About 1 hr to fix

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

          public cancel(): boolean {
            if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'cancel'); }
        
            if (this._status === tsPending) {
              const taskQueue = this.taskQueue;
        Severity: Minor
        Found in packages/platform/src/index.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 queueTask has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public queueTask<T = any>(callback: TaskCallback<T>, opts?: QueueTaskOptions): Task<T> {
            if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'queueTask'); }
        
            const { delay, preempt, persistent, reusable, suspend } = { ...defaultQueueTaskOptions, ...opts };
        
        
        Severity: Minor
        Found in packages/platform/src/index.ts - About 1 hr to fix

          Function yield has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            public async yield(): Promise<void> {
              if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'yield'); }
          
              if (this.isEmpty) {
                if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'yield empty'); }
          Severity: Minor
          Found in packages/platform/src/index.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 remove has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            public remove<T = any>(task: Task<T>): void {
              if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'remove'); }
          
              let idx = this._processing.indexOf(task);
              if (idx > -1) {
          Severity: Minor
          Found in packages/platform/src/index.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 _completeAsyncTask has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            public _completeAsyncTask(task: Task): void {
              if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'completeAsyncTask'); }
          
              if (task.suspend === true) {
                if (this._suspenderTask !== task) {
          Severity: Minor
          Found in packages/platform/src/index.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 cancel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public cancel(): boolean {
              if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'cancel'); }
          
              if (this._status === tsPending) {
                const taskQueue = this.taskQueue;
          Severity: Minor
          Found in packages/platform/src/index.ts - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                        if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'flush early async'); }
            Severity: Major
            Found in packages/platform/src/index.ts - About 45 mins to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                    if (this._delayed.length > 0) {
                      let i = -1;
                      while (++i < this._delayed.length && this._delayed[i].queueTime <= time) { /* do nothing */ }
                      this._processing.push(...this._delayed.splice(0, i));
                    }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 3 hrs to fix
              packages/platform/src/index.ts on lines 193..197

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 101.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                    if (this._delayed.length > 0) {
                      let i = -1;
                      while (++i < this._delayed.length && this._delayed[i].queueTime <= time) { /* do nothing */ }
                      this._processing.push(...this._delayed.splice(0, i));
                    }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 3 hrs to fix
              packages/platform/src/index.ts on lines 221..225

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 101.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                        if (this.persistent) {
                          taskQueue._resetPersistentTask(this);
                        } else {
                          if (persistent) {
                            // Persistent tasks never reach completed status. They're either pending, running, or canceled.
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 592..603

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 71.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (this.persistent) {
                        taskQueue._resetPersistentTask(this);
                      } else {
                        if (persistent) {
                          // Persistent tasks never reach completed status. They're either pending, running, or canceled.
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 551..562

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 71.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  if (idx > -1) {
                    this._pending.splice(idx, 1);
                    if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'remove pending'); }
                    return;
                  }
              Severity: Major
              Found in packages/platform/src/index.ts and 2 other locations - About 1 hr to fix
              packages/platform/src/index.ts on lines 348..352
              packages/platform/src/index.ts on lines 360..364

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  if (idx > -1) {
                    this._processing.splice(idx, 1);
                    if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'remove processing'); }
                    return;
                  }
              Severity: Major
              Found in packages/platform/src/index.ts and 2 other locations - About 1 hr to fix
              packages/platform/src/index.ts on lines 354..358
              packages/platform/src/index.ts on lines 360..364

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  if (idx > -1) {
                    this._delayed.splice(idx, 1);
                    if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'remove delayed'); }
                    return;
                  }
              Severity: Major
              Found in packages/platform/src/index.ts and 2 other locations - About 1 hr to fix
              packages/platform/src/index.ts on lines 348..352
              packages/platform/src/index.ts on lines 354..358

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                public enter(obj: TaskQueue | Task, method: string): void {
                  this.log(`${'  '.repeat(this.depth++)}> `, obj, method);
                }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 763..765

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                public leave(obj: TaskQueue | Task, method: string): void {
                  this.log(`${'  '.repeat(--this.depth)}< `, obj, method);
                }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 760..762

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  if (
                    this._yieldPromise !== void 0 &&
                    this._hasNoMoreFiniteWork
                  ) {
                    const p = this._yieldPromise;
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 231..238

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 59.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                    if (
                      this._yieldPromise !== void 0 &&
                      this._hasNoMoreFiniteWork
                    ) {
                      const p = this._yieldPromise;
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 422..429

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 59.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                    if (this._pending.length > 0) {
                      this._processing.push(...this._pending);
                      this._pending.length = 0;
                    }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 189..192

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                    if (this._pending.length > 0) {
                      this._processing.push(...this._pending);
                      this._pending.length = 0;
                    }
              Severity: Major
              Found in packages/platform/src/index.ts and 1 other location - About 1 hr to fix
              packages/platform/src/index.ts on lines 217..220

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status