aurelia/aurelia

View on GitHub
packages/__tests__/src/router/_shared/hooks.ts

Summary

Maintainability
F
3 wks
Test Coverage

Function getParentChildHooks has a Cognitive Complexity of 231 (exceeds 5 allowed). Consider refactoring.
Open

export function* getParentChildHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
  const parentAdd: HookName[] = [...addHooks];
  const childAdd: HookName[] = ['canLoad', 'loading', ...addHooks];
  const parentRemove: HookName[] = ['unloading', ...removeHooks];
  const childRemove: HookName[] = [...removeHooks];
Severity: Minor
Found in packages/__tests__/src/router/_shared/hooks.ts - About 4 days 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

File hooks.ts has 651 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { assert } from '@aurelia/testing';
import { HookName } from './hook-invocation-tracker.js';
import { TransitionComponent } from './component.js';
import { Transition } from './transition.js';
import { TransitionViewport } from './transition-viewport.js';
Severity: Major
Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 day to fix

    Function getParentChildHooks has 265 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function* getParentChildHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
      const parentAdd: HookName[] = [...addHooks];
      const childAdd: HookName[] = ['canLoad', 'loading', ...addHooks];
      const parentRemove: HookName[] = ['unloading', ...removeHooks];
      const childRemove: HookName[] = [...removeHooks];
    Severity: Major
    Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 day to fix

      Function getNonSiblingHooks has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getNonSiblingHooks(deferUntil, swapStrategy, phase, transitionComponents) {
        console.log('transitions', JSON.parse(JSON.stringify(transitionComponents)));
      
        const transitions: Transition[] = [];
        for (let i = 0; i < transitionComponents.length; i++) {
      Severity: Minor
      Found in packages/__tests__/src/router/_shared/hooks.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

      Function getNonSiblingHooks has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function getNonSiblingHooks(deferUntil, swapStrategy, phase, transitionComponents) {
        console.log('transitions', JSON.parse(JSON.stringify(transitionComponents)));
      
        const transitions: Transition[] = [];
        for (let i = 0; i < transitionComponents.length; i++) {
      Severity: Major
      Found in packages/__tests__/src/router/_shared/hooks.ts - About 4 hrs to fix

        Function getSingleHooks has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        export function* getSingleHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
          if (from) { yield `${phase}.${from}.canUnload`; }
          if (to) { yield `${phase}.${to}.canLoad`; }
          if (from) { yield `${phase}.${from}.unloading`; }
          if (to) { yield `${phase}.${to}.loading`; }
        Severity: Minor
        Found in packages/__tests__/src/router/_shared/hooks.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 getViewports has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getViewports(transitions: Transition[], forceParallel: boolean): {
          viewports: TransitionViewport[];
          topViewports: TransitionViewport[];
          addViewports: TransitionViewport[];
          removeViewports: TransitionViewport[];
        Severity: Minor
        Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 hr to fix

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

          export function getInterweaved(...viewports: TransitionViewport[] | string[][]) {
            const hooks: string[] = [];
            const viewportHooks = viewports[0] instanceof TransitionViewport
              ? (viewports as TransitionViewport[]).filter(viewport => viewport !== void 0).map(viewport => viewport.retrieveHooks())
              : viewports as string[][];
          Severity: Minor
          Found in packages/__tests__/src/router/_shared/hooks.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 getSingleHooks has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function* getSingleHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
            if (from) { yield `${phase}.${from}.canUnload`; }
            if (to) { yield `${phase}.${to}.canLoad`; }
            if (from) { yield `${phase}.${from}.unloading`; }
            if (to) { yield `${phase}.${to}.loading`; }
          Severity: Minor
          Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 hr to fix

            Function getViewports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function getViewports(transitions: Transition[], forceParallel: boolean): {
              viewports: TransitionViewport[];
              topViewports: TransitionViewport[];
              addViewports: TransitionViewport[];
              removeViewports: TransitionViewport[];
            Severity: Minor
            Found in packages/__tests__/src/router/_shared/hooks.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 getInterweavedViewports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function getInterweavedViewports(...viewportLists: TransitionViewport[][]) {
              const viewports: TransitionViewport[] = [];
            
              while (viewportLists.length > 0) {
                for (let i = 0, ii = viewportLists.length; i < ii; ++i) {
            Severity: Minor
            Found in packages/__tests__/src/router/_shared/hooks.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 interleave has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function* interleave(
              ...generators: Generator<string, void>[]
            ) {
              while (generators.length > 0) {
                for (let i = 0, ii = generators.length; i < ii; ++i) {
            Severity: Minor
            Found in packages/__tests__/src/router/_shared/hooks.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 getSingleHooks has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function* getSingleHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
            Severity: Minor
            Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

              Function getParentChildHooks has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export function* getParentChildHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
              Severity: Minor
              Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                Function getStopHooks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                export function* getStopHooks(root: string, p: string, c: string = '', c3 = '', c4 = '') {
                  yield `stop.${root}.detaching`;
                
                  if (p) { yield* prepend('stop', p, 'unloading', 'detaching'); }
                
                
                Severity: Minor
                Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Avoid deeply nested control flow statements.
                Open

                                if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                Severity: Major
                Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (addViewports.every(viewport => viewport.to.isLifecycleSync)) {
                              // Unload viewports bottom-up
                              // removeViewports are always empty
                              // removeViewports.forEach(viewport => hooks.push(...viewport.retrieveHooks()));
                  
                  
                  Severity: Major
                  Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                    Severity: Major
                    Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                      Severity: Major
                      Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                        Severity: Major
                        Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                switch (swapStrategy) {
                                  case 'sequential-add-first':
                                    // All lifecycle hooks are sync so unload of all happens sync after top load
                                    if (addViewports.every(viewport => viewport.to.isLifecycleSync)) {
                                      // Transition top viewport
                          Severity: Major
                          Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                            Severity: Major
                            Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                              Severity: Major
                              Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                if (from.c) { yield* prepend(phase, from.p, ...parentRemove); }
                                Severity: Major
                                Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                  Severity: Major
                                  Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    if (to.p) { yield* prepend(phase, to.p, ...parentAdd); }
                                    Severity: Major
                                    Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                      Severity: Major
                                      Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                        if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                        Severity: Major
                                        Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                    if (addViewports.every(viewport => viewport.to.isLifecycleSync)) {
                                                      // Load viewports top-down
                                                      addViewports.forEach(viewport => hooks.push(...viewport.retrieveHooks()));
                                                      // // Transition top viewport
                                                      // if (topTo !== void 0) {
                                          Severity: Major
                                          Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                if (to.p) { yield* prepend(phase, to.p, ...parentAdd); }
                                            Severity: Major
                                            Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                  if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                              Severity: Major
                                              Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                Severity: Major
                                                Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                  if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                  Severity: Major
                                                  Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                        if (to.p) { yield* prepend(phase, to.p, ...parentAdd); }
                                                    Severity: Major
                                                    Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                      Severity: Major
                                                      Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                        Severity: Major
                                                        Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                              if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                          Severity: Major
                                                          Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                            Severity: Major
                                                            Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                  if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                              Severity: Major
                                                              Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                    if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                Severity: Major
                                                                Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                  if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                  Severity: Major
                                                                  Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                    if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                    Severity: Major
                                                                    Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                      Severity: Major
                                                                      Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                        if (to.p) { yield* prepend(phase, to.p, ...parentAdd); }
                                                                        Severity: Major
                                                                        Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                          Severity: Major
                                                                          Found in packages/__tests__/src/router/_shared/hooks.ts - About 45 mins to fix

                                                                            Function getStopHooks has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                            export function* getStopHooks(root: string, p: string, c: string = '', c3 = '', c4 = '') {
                                                                            Severity: Minor
                                                                            Found in packages/__tests__/src/router/_shared/hooks.ts - About 35 mins to fix

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

                                                                              export function getHooks(deferUntil, swapStrategy, phase, ...siblingTransitions) {
                                                                                const siblingHooks: string[][] = siblingTransitions.map(sibling => getNonSiblingHooks(deferUntil, swapStrategy, phase, sibling));
                                                                              
                                                                                if (deferUntil === 'guard-hooks' || deferUntil === 'load-hooks') {
                                                                                  // for (let i = 0; i <= siblingHooks.length - 2; i++) {
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.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 4 locations. Consider refactoring.
                                                                              Open

                                                                                          case 'all-async':
                                                                                            if (from.p) {
                                                                                              yield* interleave(
                                                                                                (function* () {
                                                                                                  if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 1 day to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 788..810
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 821..843
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 943..965

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

                                                                              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

                                                                                          case 'all-async':
                                                                                            if (from.p) {
                                                                                              yield* interleave(
                                                                                                (function* () {
                                                                                                  if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 1 day to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 788..810
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 821..843
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 909..931

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

                                                                              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

                                                                                          case 'all-async':
                                                                                            if (from.p) {
                                                                                              yield* interleave(
                                                                                                (function* () {
                                                                                                  if (to.p) { yield* prepend(phase, to.p, ...parentAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 1 day to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 788..810
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 909..931
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 943..965

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

                                                                              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

                                                                                          case 'all-async':
                                                                                            if (from.p) {
                                                                                              yield* interleave(
                                                                                                (function* () {
                                                                                                  if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 1 day to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 821..843
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 909..931
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 943..965

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

                                                                              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

                                                                              function* interleave(
                                                                                ...generators: Generator<string, void>[]
                                                                              ) {
                                                                                while (generators.length > 0) {
                                                                                  for (let i = 0, ii = generators.length; i < ii; ++i) {
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 6 hrs to fix
                                                                              packages/__tests__/src/router/config-tests.spec.ts on lines 62..81

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

                                                                              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

                                                                                          case 'all-sync':
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 932..938

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

                                                                              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

                                                                                          case 'all-sync':
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 898..904

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

                                                                              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

                                                                                      case 'sequential-remove-first':
                                                                                        if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                        if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                        yield* prepend(phase, to.p, ...parentAdd);
                                                                                        if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 778..783
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 811..816
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 996..1001

                                                                              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

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

                                                                                          case 'all-sync':
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 778..783
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 996..1001
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 1004..1009

                                                                              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

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

                                                                                          case 'all-sync':
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 778..783
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 811..816
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 1004..1009

                                                                              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

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

                                                                                          case 'all-sync':
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 811..816
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 996..1001
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 1004..1009

                                                                              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

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

                                                                                          case 'all-sync':
                                                                                            yield* prepend(phase, to.p, ...parentAdd);
                                                                                            if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                            if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                            if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 1010..1015

                                                                              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

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

                                                                                      case 'sequential-add-first':
                                                                                        yield* prepend(phase, to.p, ...parentAdd);
                                                                                        if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                        if (from.p) { yield* prepend(phase, from.p, ...parentRemove); }
                                                                                        if (to.c) { yield* prepend(phase, to.c, ...childAdd); }
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 3 hrs to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 844..849

                                                                              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

                                                                              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/_shared/hooks.ts and 1 other location - About 3 hrs to fix
                                                                              packages/__tests__/src/router/runner.spec.ts on lines 430..435

                                                                              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

                                                                              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/_shared/hooks.ts and 1 other location - About 2 hrs to fix
                                                                              packages/__tests__/src/router/runner.spec.ts on lines 436..439

                                                                              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

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

                                                                              function* prepend(
                                                                                prefix: string,
                                                                                component: string,
                                                                                ...calls: (HookName | '')[]
                                                                              ) {
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 2 hrs to fix
                                                                              packages/__tests__/src/router/config-tests.spec.ts on lines 28..40

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

                                                                              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

                                                                                                (function* () {
                                                                                                  if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                                  yield* prepend(phase, from.p, ...parentRemove);
                                                                                                })(),
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 55 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 862..865

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

                                                                              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

                                                                                                (function* () {
                                                                                                  if (from.c) { yield* prepend(phase, from.c, ...childRemove); }
                                                                                                  yield* prepend(phase, from.p, ...parentRemove);
                                                                                                })(),
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 55 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 758..761

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

                                                                              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

                                                                                return {
                                                                                  viewports,
                                                                                  topViewports,
                                                                                  addViewports,
                                                                                  removeViewports,
                                                                              Severity: Major
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 3 other locations - About 40 mins to fix
                                                                              packages-tooling/plugin-conventions/src/strip-meta-data.ts on lines 89..89
                                                                              packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 926..926
                                                                              packages/__tests__/src/compat-v1/event-delegator.spec.ts on lines 82..82

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

                                                                              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

                                                                                if (deferUntil === 'load-hooks' || deferUntil === 'guard-hooks') {
                                                                                  if (to.c) { yield `${phase}.${to.c}.canLoad`; }
                                                                              
                                                                                  childAdd.shift();
                                                                                }
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 35 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 744..748

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

                                                                              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

                                                                                if (deferUntil === 'load-hooks') {
                                                                                  if (to.c) { yield `${phase}.${to.c}.loading`; }
                                                                              
                                                                                  childAdd.shift();
                                                                                }
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 35 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 730..734

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

                                                                              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

                                                                              export function getPrepended(prefix: string, component: string, ...hooks: (HookName | '')[]) {
                                                                                return hooks.map(hook => hook !== '' ? `${prefix}.${component}.${hook}` : '');
                                                                              }
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 1 other location - About 35 mins to fix
                                                                              packages/__tests__/src/router/_shared/transition-viewport.ts on lines 19..21

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

                                                                              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

                                                                                      case 'all-sync':
                                                                                        if (from) { yield* prepend(phase, from, ...removeHooks); }
                                                                                        if (to) { yield* prepend(phase, to, ...addHooks); }
                                                                                        break;
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 2 other locations - About 30 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 708..711
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 712..715

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

                                                                              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

                                                                                  case 'sequential-add-first':
                                                                                    if (to) { yield* prepend(phase, to, ...addHooks); }
                                                                                    if (from) { yield* prepend(phase, from, ...removeHooks); }
                                                                                    break;
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 2 other locations - About 30 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 702..705
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 708..711

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

                                                                              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

                                                                                  case 'sequential-remove-first':
                                                                                    if (from) { yield* prepend(phase, from, ...removeHooks); }
                                                                                    if (to) { yield* prepend(phase, to, ...addHooks); }
                                                                                    break;
                                                                              Severity: Minor
                                                                              Found in packages/__tests__/src/router/_shared/hooks.ts and 2 other locations - About 30 mins to fix
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 702..705
                                                                              packages/__tests__/src/router/_shared/hooks.ts on lines 712..715

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

                                                                              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