aurelia/aurelia

View on GitHub

Showing 5,354 of 5,354 total issues

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

  describe(`observeShift`, function () {
    const initArr = [[], [1], [1, 2]];
    const repeatArr = [1, 2, 3, 4];

    eachCartesianJoin(
Severity: Major
Found in packages/__tests__/src/2-runtime/array-observer.spec.ts and 1 other location - About 2 days to fix
packages/__tests__/src/2-runtime/array-observer.spec.ts on lines 1590..1630

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

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

  describe(`observePop`, function () {
    const initArr = [[], [1], [1, 2]];
    const repeatArr = [1, 2, 3, 4];

    eachCartesianJoin(
Severity: Major
Found in packages/__tests__/src/2-runtime/array-observer.spec.ts and 1 other location - About 2 days to fix
packages/__tests__/src/2-runtime/array-observer.spec.ts on lines 1632..1672

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

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

Function getTestData has 407 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function* getTestData() {
    {
      class MyElement {
        public static hookInvoked: boolean = false;
        public static processContent(_node: INode, _p: IPlatform) {
Severity: Major
Found in packages/__tests__/src/3-runtime-html/process-content.spec.ts - About 2 days to fix

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

          {
            title: 'observes .find()',
            init: () => Array.from(
              { length: 3 },
              (_, idx) => ({ id: idx + 1, name: `box ${idx + 1}`, delivered: false })
    packages/__tests__/src/3-runtime-html/decorator-watch.computed.spec.ts on lines 652..673

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

    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

          {
            title: 'observes .some()',
            init: () => Array.from(
              { length: 3 },
              (_, idx) => ({ id: idx + 1, name: `box ${idx + 1}`, delivered: false })
    packages/__tests__/src/3-runtime-html/decorator-watch.computed.spec.ts on lines 605..626

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

    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

    Function processInstructions has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
    Open

      public async processInstructions(instructions: RoutingInstruction[], earlierMatchedInstructions: RoutingInstruction[], navigation: Navigation, coordinator: NavigationCoordinator, configuredRoutePath = ''): Promise<Endpoint[]> {
        const router = this.router;
        const options = router.configuration.options;
    
        // If there are instructions that aren't part of an already found configured route...
    Severity: Minor
    Found in packages/router/src/routing-scope.ts - About 1 day 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 (hook) {
                case 'attached': logs.push(
                  // because the hooks are invoked in parallel
                  `${prefix}.c-2.attached.leave`,
                  `${prefix}.c-2.attached.enter`,
    packages/__tests__/src/3-runtime-html/controller.deactivation.partially-activated.spec.ts on lines 1556..1595

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

    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 (hook) {
                case 'attached': logs.push(
                  // because the hooks are invoked in parallel
                  `${prefix}.c-2.attached.leave`,
                  `${prefix}.c-2.attached.enter`,
    packages/__tests__/src/3-runtime-html/controller.deactivation.partially-activated.spec.ts on lines 906..945

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

    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

    const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
      let cooked: string = errorsMap[name];
      for (let i = 0; i < details.length; ++i) {
        const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
        let matches = regex.exec(cooked);
    Severity: Major
    Found in packages/fetch-client/src/errors.ts and 2 other locations - About 1 day to fix
    packages/dialog/src/errors.ts on lines 38..66
    packages/i18n/src/errors.ts on lines 28..56

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

    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

    const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
      let cooked: string = errorsMap[name];
      for (let i = 0; i < details.length; ++i) {
        const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
        let matches = regex.exec(cooked);
    Severity: Major
    Found in packages/i18n/src/errors.ts and 2 other locations - About 1 day to fix
    packages/dialog/src/errors.ts on lines 38..66
    packages/fetch-client/src/errors.ts on lines 44..72

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

    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

    const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
      let cooked: string = errorsMap[name];
      for (let i = 0; i < details.length; ++i) {
        const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
        let matches = regex.exec(cooked);
    Severity: Major
    Found in packages/dialog/src/errors.ts and 2 other locations - About 1 day to fix
    packages/fetch-client/src/errors.ts on lines 44..72
    packages/i18n/src/errors.ts on lines 28..56

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

    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

            async function testFn(fn: (ctx: $ctx) => Promise<void>) {
              const ctx = TestContext.create();
              const au = new Aurelia(ctx.container);
              const host = ctx.createElement("div");
    
    
    packages/__tests__/src/3-runtime-html/repeat.keyed.set.spec.ts on lines 53..85

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

    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

            async function testFn(fn: (ctx: $ctx) => Promise<void>) {
              const ctx = TestContext.create();
              const au = new Aurelia(ctx.container);
              const host = ctx.createElement("div");
    
    
    packages/__tests__/src/3-runtime-html/repeat.keyed.map.spec.ts on lines 54..86

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

    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

          yield new SiblingHookTestData(
            ticks,
            root,
            scopes,
            assertStartLog,
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts and 3 other locations - About 1 day to fix
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4117..4308
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5091..5282
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5284..5475

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

    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

          yield new SiblingHookTestData(
            ticks,
            root,
            scopes,
            assertStartLog,
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts and 3 other locations - About 1 day to fix
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4117..4308
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4310..4501
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5091..5282

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

    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

          yield new SiblingHookTestData(
            ticks,
            root,
            scopes,
            assertStartLog,
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts and 3 other locations - About 1 day to fix
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4310..4501
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5091..5282
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5284..5475

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

    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

          yield new SiblingHookTestData(
            ticks,
            root,
            scopes,
            assertStartLog,
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts and 3 other locations - About 1 day to fix
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4117..4308
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 4310..4501
    packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 5284..5475

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

    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

    Function getTestData has 378 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function* getTestData() {
        {
          @customElement({ name: 'app', template: '<div ref="container" id="cr">1</div><child ref="child" id="child"></child><div ref="container2" id="cr2">11</div>' })
          class App {
            public readonly container: HTMLElement = void 0;
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/integration.spec.ts - About 1 day to fix

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

            if (!viewport.to.isEmpty) {
              hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.binding.enter`);
              hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.binding.leave`);
              hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.bound.enter`);
              hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.bound.leave`);
      Severity: Major
      Found in packages/__tests__/src/router/_shared/hook-rules.ts and 2 other locations - About 1 day to fix
      packages/__tests__/src/router/_shared/hook-rules.ts on lines 148..157
      packages/__tests__/src/router/_shared/hook-rules.ts on lines 176..185

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

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

                if (!viewport.to.isEmpty) {
                  hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.binding.enter`);
                  hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.binding.leave`);
                  hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.bound.enter`);
                  hooks.push(`${phase}:${viewport.name}.${viewport.to.name}.bound.leave`);
      Severity: Major
      Found in packages/__tests__/src/router/_shared/hook-rules.ts and 2 other locations - About 1 day to fix
      packages/__tests__/src/router/_shared/hook-rules.ts on lines 98..107
      packages/__tests__/src/router/_shared/hook-rules.ts on lines 148..157

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

      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

      Severity
      Category
      Status
      Source
      Language