aurelia/aurelia

View on GitHub
packages/__tests__/src/router/runner.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

File runner.spec.ts has 456 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Runner, Step } from '@aurelia/router';
import { assert } from '@aurelia/testing';

const createTimedPromise = (value, time: number, previousValue?, reject = false): Promise<unknown> => {
  return new Promise((res, rej) => {
Severity: Minor
Found in packages/__tests__/src/router/runner.spec.ts - About 6 hrs to fix

    Function testIt has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        async function testIt(components: number, connected = true, defaults = [1, 1], timings: any = {}) {
          const root1 = new Controller('root', [
            new Controller('parent-1', [
              new Controller('child-1.1', [], connected, ...(timings['child-1.1'] ?? defaults)),
              new Controller('child-1.2', [], connected, ...(timings['child-1.2'] ?? defaults)),
    Severity: Major
    Found in packages/__tests__/src/router/runner.spec.ts - About 3 hrs to fix

      Function getTick has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        public getTick(method: Method, action: Action): number {
          // // If we've got a parent, we're either first child or in parallel...
          // const ticks = this.parent !== null
          //   //  ...so use parent tick
          //   ? this.parent.getTick('activate', 'enter')
      Severity: Minor
      Found in packages/__tests__/src/router/runner.spec.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 invocations has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public static invocations(components: number, connected = true, defaults: number[] = [1, 1], timings: Timings = {}) {
          const root = new InvocationNode('root', [
            new InvocationNode('parent-1', [
              new InvocationNode('child-1.1', [], connected, timings['child-1.1'] ?? defaults),
              new InvocationNode('child-1.2', [], connected, timings['child-1.2'] ?? defaults),
      Severity: Major
      Found in packages/__tests__/src/router/runner.spec.ts - About 2 hrs to fix

        Function logOutcome has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function logOutcome(actual: any, expected: any): any {
          const outcome = [];
          let leftMax = 0;
          for (let i = 0, ii = Math.max(actual.length, expected.length); i < ii; i++) {
            // outcome.push(actual[i] !== expected[i] ? `${actual[i]} <-> ${expected[i]}` : actual[i]);
        Severity: Minor
        Found in packages/__tests__/src/router/runner.spec.ts - About 25 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

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

              switch (components) {
                case 3:
                  root1.children.pop();
                  root1.children.forEach(child => child.children.pop());
                  break;
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 1 day to fix
        packages/__tests__/src/router/runner.spec.ts on lines 509..528

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

        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

            switch (components) {
              case 3:
                root.children.pop();
                root.children.forEach(child => child.children.pop());
                break;
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 1 day to fix
        packages/__tests__/src/router/runner.spec.ts on lines 283..302

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

        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 binding(caller: any, state: string | null): void | Step<void> | Promise<void> {
                this.log(`binding.enter(${this.bindingTiming}) [${caller?.id}] [${state}]`, '  ');
                return Runner.run<void>(this.connected ? caller : null,
                  () => wait(this.bindingTiming), // Promise.resolve(), // pretend this is a user hook return value
                  () => { this.log(`binding.leave`, '  '); },
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 6 hrs to fix
        packages/__tests__/src/router/runner.spec.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 162.

        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 bound(caller: any, state: string | null): void | Step<void> | Promise<void> {
                this.log(`bound.enter(${this.bindingTiming}) [${caller?.id}] [${state}]`, '  ');
                return Runner.run<void>(this.connected ? caller : null,
                  () => wait(this.boundTiming), // Promise.resolve(), // pretend this is a user hook return value
                  () => { this.log(`bound.leave`, '  '); },
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 6 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 223..230

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

        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

          for (let i = 0, ii = Math.max(actual.length, expected.length); i < ii; i++) {
            // outcome.push(actual[i] !== expected[i] ? `${actual[i]} <-> ${expected[i]}` : actual[i]);
            const [left, right] = [actual[i], expected[i]];
            leftMax = Math.max((left ?? '').length, leftMax);
            outcome.push([left, right]);
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 3 hrs to fix
        packages/__tests__/src/router/_shared/hooks.ts on lines 1049..1054

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

        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

                activate.then(async () => {
                  logTicks = false;
                  // console.log(done.replace('#TICKS#', `${ticks}`));
                  Step.id = 0;
                  Runner.roots = {};
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 324..333

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

        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

              } else {
                logTicks = false;
                // console.log(done.replace('#TICKS#', `${ticks}`));
                Step.id = 0;
                Runner.roots = {};
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 314..323

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

        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 4 locations. Consider refactoring.
        Open

                new Controller('parent-1', [
                  new Controller('child-1.1', [], connected, ...(timings['child-1.1'] ?? defaults)),
                  new Controller('child-1.2', [], connected, ...(timings['child-1.2'] ?? defaults)),
                  new Controller('child-1.3', [], connected, ...(timings['child-1.3'] ?? defaults)),
                  new Controller('child-1.4', [], connected, ...(timings['child-1.4'] ?? defaults)),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 262..267
        packages/__tests__/src/router/runner.spec.ts on lines 268..273
        packages/__tests__/src/router/runner.spec.ts on lines 274..279

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

        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 4 locations. Consider refactoring.
        Open

                new Controller('parent-4', [
                  new Controller('child-4.1', [], connected, ...(timings['child-4.1'] ?? defaults)),
                  new Controller('child-4.2', [], connected, ...(timings['child-4.2'] ?? defaults)),
                  new Controller('child-4.3', [], connected, ...(timings['child-4.3'] ?? defaults)),
                  new Controller('child-4.4', [], connected, ...(timings['child-4.4'] ?? defaults)),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 256..261
        packages/__tests__/src/router/runner.spec.ts on lines 262..267
        packages/__tests__/src/router/runner.spec.ts on lines 268..273

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

        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 4 locations. Consider refactoring.
        Open

                new Controller('parent-3', [
                  new Controller('child-3.1', [], connected, ...(timings['child-3.1'] ?? defaults)),
                  new Controller('child-3.2', [], connected, ...(timings['child-3.2'] ?? defaults)),
                  new Controller('child-3.3', [], connected, ...(timings['child-3.3'] ?? defaults)),
                  new Controller('child-3.4', [], connected, ...(timings['child-3.4'] ?? defaults)),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 256..261
        packages/__tests__/src/router/runner.spec.ts on lines 262..267
        packages/__tests__/src/router/runner.spec.ts on lines 274..279

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

        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 4 locations. Consider refactoring.
        Open

                new Controller('parent-2', [
                  new Controller('child-2.1', [], connected, ...(timings['child-2.1'] ?? defaults)),
                  new Controller('child-2.2', [], connected, ...(timings['child-2.2'] ?? defaults)),
                  new Controller('child-2.3', [], connected, ...(timings['child-2.3'] ?? defaults)),
                  new Controller('child-2.4', [], connected, ...(timings['child-2.4'] ?? defaults)),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 3 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 256..261
        packages/__tests__/src/router/runner.spec.ts on lines 268..273
        packages/__tests__/src/router/runner.spec.ts on lines 274..279

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

        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

          for (const out of outcome) {
            const [left, right] = out;
            console.log(`%c ${left}`, `color: dark${left === right ? 'green' : 'red'}; padding-right: ${(leftMax - (left ?? '').length) / 2}em;`, ` ${right}`);
          }
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 1 other location - About 2 hrs to fix
        packages/__tests__/src/router/_shared/hooks.ts on lines 1056..1059

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

        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 4 locations. Consider refactoring.
        Open

              new InvocationNode('parent-4', [
                new InvocationNode('child-4.1', [], connected, timings['child-4.1'] ?? defaults),
                new InvocationNode('child-4.2', [], connected, timings['child-4.2'] ?? defaults),
                new InvocationNode('child-4.3', [], connected, timings['child-4.3'] ?? defaults),
                new InvocationNode('child-4.4', [], connected, timings['child-4.4'] ?? defaults),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 2 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 483..488
        packages/__tests__/src/router/runner.spec.ts on lines 489..494
        packages/__tests__/src/router/runner.spec.ts on lines 495..500

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

        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 4 locations. Consider refactoring.
        Open

              new InvocationNode('parent-2', [
                new InvocationNode('child-2.1', [], connected, timings['child-2.1'] ?? defaults),
                new InvocationNode('child-2.2', [], connected, timings['child-2.2'] ?? defaults),
                new InvocationNode('child-2.3', [], connected, timings['child-2.3'] ?? defaults),
                new InvocationNode('child-2.4', [], connected, timings['child-2.4'] ?? defaults),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 2 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 483..488
        packages/__tests__/src/router/runner.spec.ts on lines 495..500
        packages/__tests__/src/router/runner.spec.ts on lines 501..506

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

        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 4 locations. Consider refactoring.
        Open

              new InvocationNode('parent-1', [
                new InvocationNode('child-1.1', [], connected, timings['child-1.1'] ?? defaults),
                new InvocationNode('child-1.2', [], connected, timings['child-1.2'] ?? defaults),
                new InvocationNode('child-1.3', [], connected, timings['child-1.3'] ?? defaults),
                new InvocationNode('child-1.4', [], connected, timings['child-1.4'] ?? defaults),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 2 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 489..494
        packages/__tests__/src/router/runner.spec.ts on lines 495..500
        packages/__tests__/src/router/runner.spec.ts on lines 501..506

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

        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 4 locations. Consider refactoring.
        Open

              new InvocationNode('parent-3', [
                new InvocationNode('child-3.1', [], connected, timings['child-3.1'] ?? defaults),
                new InvocationNode('child-3.2', [], connected, timings['child-3.2'] ?? defaults),
                new InvocationNode('child-3.3', [], connected, timings['child-3.3'] ?? defaults),
                new InvocationNode('child-3.4', [], connected, timings['child-3.4'] ?? defaults),
        Severity: Major
        Found in packages/__tests__/src/router/runner.spec.ts and 3 other locations - About 2 hrs to fix
        packages/__tests__/src/router/runner.spec.ts on lines 483..488
        packages/__tests__/src/router/runner.spec.ts on lines 489..494
        packages/__tests__/src/router/runner.spec.ts on lines 501..506

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

        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