aurelia/aurelia

View on GitHub
packages/route-recognizer/src/index.ts

Summary

Maintainability
F
1 wk
Test Coverage
A
96%

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

export interface IConfigurableRoute<T> {
  readonly path: string;
  readonly caseSensitive?: boolean;
  readonly handler: T;
}
Severity: Major
Found in packages/route-recognizer/src/index.ts - About 1 day to fix

    Function advance has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

      public advance(ch: string): void {
        const { chars, states, skippedStates, result } = this;
        let stateToAdd: AnyState<T> | null = null;
    
        let matchCount = 0;
    Severity: Minor
    Found in packages/route-recognizer/src/index.ts - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _finalize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      public _finalize(): boolean {
        function collectSkippedStates(
          skippedStates: DynamicState<T>[],
          state: AnyState<T>,
        ): void {
    Severity: Minor
    Found in packages/route-recognizer/src/index.ts - About 4 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 compareTo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      public compareTo(b: Candidate<T>): -1 | 1 | 0 {
        const statesA = this.states;
        const statesB = b.states;
    
        for (let iA = 0, iB = 0, ii = Math.max(statesA.length, statesB.length); iA < ii; ++iA) {
    Severity: Minor
    Found in packages/route-recognizer/src/index.ts - About 4 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 $add has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      private $add(route: IConfigurableRoute<T>, addResidue: boolean): Endpoint<T> {
        const path = route.path;
        const lookup = this.endpointLookup;
        if(lookup.has(path)) throw createError(`Cannot add duplicate path '${path}'.`);
        const $route = new ConfigurableRoute(path, route.caseSensitive === true, route.handler);
    Severity: Minor
    Found in packages/route-recognizer/src/index.ts - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function advance has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public advance(ch: string): void {
        const { chars, states, skippedStates, result } = this;
        let stateToAdd: AnyState<T> | null = null;
    
        let matchCount = 0;
    Severity: Major
    Found in packages/route-recognizer/src/index.ts - About 2 hrs to fix

      Function compareTo has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public compareTo(b: Candidate<T>): -1 | 1 | 0 {
          const statesA = this.states;
          const statesB = b.states;
      
          for (let iA = 0, iB = 0, ii = Math.max(statesA.length, statesB.length); iA < ii; ++iA) {
      Severity: Major
      Found in packages/route-recognizer/src/index.ts - About 2 hrs to fix

        Function $add has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private $add(route: IConfigurableRoute<T>, addResidue: boolean): Endpoint<T> {
            const path = route.path;
            const lookup = this.endpointLookup;
            if(lookup.has(path)) throw createError(`Cannot add duplicate path '${path}'.`);
            const $route = new ConfigurableRoute(path, route.caseSensitive === true, route.handler);
        Severity: Minor
        Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

          Function _getParams has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

            public _getParams(): Record<string, string | undefined> {
              let params = this.params;
              if (params != null) return params;
              const { states, chars, endpoint } = this;
          
          
          Severity: Minor
          Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

            public add(routeOrRoutes: IConfigurableRoute<T> | readonly IConfigurableRoute<T>[], addResidue: boolean = false): void {
              let params: readonly Parameter[];
              let endpoint: Endpoint<T>;
              if (routeOrRoutes instanceof Array) {
                for (const route of routeOrRoutes) {
          Severity: Minor
          Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public constructor(
              public readonly prevState: AnyState<T> | null,
              public readonly segment: AnySegment<T> | null,
              public readonly value: string,
            ) {
          Severity: Minor
          Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

            Function _getParams has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public _getParams(): Record<string, string | undefined> {
                let params = this.params;
                if (params != null) return params;
                const { states, chars, endpoint } = this;
            
            
            Severity: Minor
            Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

              Function $process has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function $process(
                    nextState: AnyState<T>,
                    skippedState: DynamicState<T> | null,
                  ): void {
                    if (nextState.isMatch(ch)) {
              Severity: Minor
              Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

                Function _finalize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public _finalize(): boolean {
                    function collectSkippedStates(
                      skippedStates: DynamicState<T>[],
                      state: AnyState<T>,
                    ): void {
                Severity: Minor
                Found in packages/route-recognizer/src/index.ts - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (nextState.nextStates !== null) {
                                  for (const $nextState of nextState.nextStates) {
                                    collectSkippedStates(skippedStates, $nextState);
                                  }
                                }
                  Severity: Major
                  Found in packages/route-recognizer/src/index.ts - About 45 mins to fix

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

                      private $recognize(path: string): RecognizedRoute<T> | null {
                        path = decodeURI(path);
                    
                        if (!path.startsWith('/')) {
                          path = `/${path}`;
                    Severity: Minor
                    Found in packages/route-recognizer/src/index.ts - About 35 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid too many return statements within this function.
                    Open

                        return 0;
                    Severity: Major
                    Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return 1;
                      Severity: Major
                      Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return 1;
                        Severity: Major
                        Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return -1;
                          Severity: Major
                          Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return -1;
                            Severity: Major
                            Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return -1;
                              Severity: Major
                              Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return 1;
                                Severity: Major
                                Found in packages/route-recognizer/src/index.ts - About 30 mins to fix

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

                                    public appendTo(state: AnyState<T>): StaticState<T> {
                                      const { value, value: { length } } = this;
                                  
                                      if (this.caseSensitive) {
                                        for (let i = 0; i < length; ++i) {
                                  Severity: Minor
                                  Found in packages/route-recognizer/src/index.ts - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

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

                                    public equals(b: AnySegment<T>): boolean {
                                      return (
                                        b.kind === SegmentKind.static &&
                                        b.caseSensitive === this.caseSensitive &&
                                        b.value === this.value
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 745..751

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                    public equals(b: AnySegment<T>): boolean {
                                      return (
                                        b.kind === SegmentKind.dynamic &&
                                        b.optional === this.optional &&
                                        b.name === this.name
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 714..720

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

                                  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 SegmentKind.residue:
                                          this.length = prevState!.length + 1;
                                          this.isSeparator = false;
                                          this.isDynamic = true;
                                          this.isOptional = false;
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 595..600

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

                                  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 SegmentKind.static:
                                          this.length = prevState!.length + 1;
                                          this.isSeparator = false;
                                          this.isDynamic = false;
                                          this.isOptional = false;
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 589..594

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

                                  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

                                    public satisfiesPattern(value: string): boolean {
                                      if (this.pattern === null) return true;
                                      this.pattern.lastIndex = 0;
                                      return this.pattern.test(value);
                                    }
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 15..19

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

                                  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

                                    public satisfiesPattern(value: string): boolean {
                                      if (this.pattern === null) return true;
                                      this.pattern.lastIndex = 0;
                                      return this.pattern.test(value);
                                    }
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 753..757

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                    public appendTo(state: AnyState<T>): StarState<T> {
                                      state = state.append(
                                        /* segment */this,
                                        /* value   */'',
                                      );
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 736..743

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                    public appendTo(state: AnyState<T>): DynamicState<T> {
                                      state = state.append(
                                        /* segment */this,
                                        /* value   */'/',
                                      );
                                  Severity: Major
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 1 hr to fix
                                  packages/route-recognizer/src/index.ts on lines 766..773

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

                                  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

                                          endpoint.residualEndpoint = this.$add({ ...routeOrRoutes, path: `${routeOrRoutes.path}/*${RESIDUE}` }, true);
                                  Severity: Minor
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 35 mins to fix
                                  packages/route-recognizer/src/index.ts on lines 398..398

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

                                          endpoint.residualEndpoint = this.$add({ ...route, path: `${route.path}/*${RESIDUE}` }, true);
                                  Severity: Minor
                                  Found in packages/route-recognizer/src/index.ts and 1 other location - About 35 mins to fix
                                  packages/route-recognizer/src/index.ts on lines 405..405

                                  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

                                  There are no issues that match your filters.

                                  Category
                                  Status