aurelia/aurelia

View on GitHub
packages/router/src/endpoints/viewport.ts

Summary

Maintainability
F
1 wk
Test Coverage

File viewport.ts has 682 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { IContainer } from '@aurelia/kernel';
import { CustomElement, IHydratedController, IHydratedParentController, ICustomElementController } from '@aurelia/runtime-html';
import { ComponentAppellation, IRouteableComponent, RouteableComponentType, LoadInstruction } from '../interfaces';
import { IRouter } from '../router';
import { arrayRemove } from '../utilities/utils';
Severity: Major
Found in packages/router/src/endpoints/viewport.ts - About 1 day to fix

    Function transition has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public async transition(coordinator: NavigationCoordinator): Promise<void> {
        const navigatingPrefix = this.router.configuration.options.indicators.viewportNavigating;
    
        this.coordinators.push(coordinator);
        // If this isn't the first coordinator, a navigation is already in process...
    Severity: Major
    Found in packages/router/src/endpoints/viewport.ts - About 6 hrs to fix

      Viewport has 35 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Viewport extends Endpoint {
        /**
         * The contents of the viewport. New contents are pushed to this, making
         * the last one the active one. It always holds at least one content, so
         * that there's always a current content.
      Severity: Minor
      Found in packages/router/src/endpoints/viewport.ts - About 4 hrs to fix

        Function transition has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

          public async transition(coordinator: NavigationCoordinator): Promise<void> {
            const navigatingPrefix = this.router.configuration.options.indicators.viewportNavigating;
        
            this.coordinators.push(coordinator);
            // If this isn't the first coordinator, a navigation is already in process...
        Severity: Minor
        Found in packages/router/src/endpoints/viewport.ts - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function setNextContent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          public setNextContent(instruction: RoutingInstruction, navigation: Navigation): TransitionAction {
            instruction.endpoint.set(this);
            this.clear = instruction.isClear(this.router);
        
            const content = this.getContent();
        Severity: Minor
        Found in packages/router/src/endpoints/viewport.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 setNextContent has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public setNextContent(instruction: RoutingInstruction, navigation: Navigation): TransitionAction {
            instruction.endpoint.set(this);
            this.clear = instruction.isClear(this.router);
        
            const content = this.getContent();
        Severity: Major
        Found in packages/router/src/endpoints/viewport.ts - About 2 hrs to fix

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

            public setConnectedCE(connectedCE: IConnectedCustomElement, options: IViewportOptions): void {
              options = options ?? {};
              if (this.connectedCE !== connectedCE) {
                // TODO: Restore this state on navigation cancel
                this.previousViewportState = { ...this };
          Severity: Minor
          Found in packages/router/src/endpoints/viewport.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 cancelContentChange has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public cancelContentChange(coordinator: NavigationCoordinator, noExitStep: Step<void> | null = null): void | Step<void> {
              // First cancel content change in all children
              [...new Set(this.scope.children.map(scope => scope.endpoint))].forEach(child => child.cancelContentChange(coordinator, noExitStep));
          
              const nextContentIndex = this.contents.findIndex(content => content.navigation === coordinator.navigation);
          Severity: Minor
          Found in packages/router/src/endpoints/viewport.ts - About 1 hr to fix

            Function remove has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public remove(step: Step | null, connectedCE: IConnectedCustomElement | null): boolean | Promise<boolean> {
                // TODO: Review this: should it go from promise to value somewhere?
                if (this.connectedCE === connectedCE) {
                  return Runner.run(step,
                    (innerStep: Step<void>) => {
            Severity: Minor
            Found in packages/router/src/endpoints/viewport.ts - About 1 hr to fix

              Function setConnectedCE has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public setConnectedCE(connectedCE: IConnectedCustomElement, options: IViewportOptions): void {
                  options = options ?? {};
                  if (this.connectedCE !== connectedCE) {
                    // TODO: Restore this state on navigation cancel
                    this.previousViewportState = { ...this };
              Severity: Minor
              Found in packages/router/src/endpoints/viewport.ts - About 1 hr to fix

                Function finalizeContentChange has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public finalizeContentChange(coordinator: NavigationCoordinator, step: Step<void> | null): void | Step<void> {
                    const nextContentIndex = this.contents.findIndex(content => content.navigation === coordinator.navigation);
                    let nextContent = this.contents[nextContentIndex];
                    const previousContent = this.contents[nextContentIndex - 1];
                    // const previousContents = this.contents.slice(0, nextContentIndex);
                Severity: Minor
                Found in packages/router/src/endpoints/viewport.ts - About 1 hr to fix

                  Function getTitle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public getTitle(navigation: Navigation): string {
                      if (this.options.noTitle) {
                        return '';
                      }
                      const componentType = this.getComponentType();
                  Severity: Minor
                  Found in packages/router/src/endpoints/viewport.ts - About 1 hr to fix

                    Function getTitle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      public getTitle(navigation: Navigation): string {
                        if (this.options.noTitle) {
                          return '';
                        }
                        const componentType = this.getComponentType();
                    Severity: Minor
                    Found in packages/router/src/endpoints/viewport.ts - About 55 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 false;
                    Severity: Major
                    Found in packages/router/src/endpoints/viewport.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return this.transitionAction = 'skip';
                      Severity: Major
                      Found in packages/router/src/endpoints/viewport.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return this.transitionAction = 'skip';
                        Severity: Major
                        Found in packages/router/src/endpoints/viewport.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return this.transitionAction = 'swap';
                          Severity: Major
                          Found in packages/router/src/endpoints/viewport.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return this.transitionAction = 'reload';
                            Severity: Major
                            Found in packages/router/src/endpoints/viewport.ts - About 30 mins to fix

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

                                public getContent(): ViewportContent {
                                  // If there's only one content, it's always content
                                  if (this.contents.length === 1) {
                                    return this.contents[0];
                                  }
                              Severity: Minor
                              Found in packages/router/src/endpoints/viewport.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

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

                                public finalizeContentChange(coordinator: NavigationCoordinator, step: Step<void> | null): void | Step<void> {
                                  const nextContentIndex = this.contents.findIndex(content => content.navigation === coordinator.navigation);
                                  let nextContent = this.contents[nextContentIndex];
                                  const previousContent = this.contents[nextContentIndex - 1];
                                  // const previousContents = this.contents.slice(0, nextContentIndex);
                              Severity: Minor
                              Found in packages/router/src/endpoints/viewport.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

                                    case 'detach-attach-simultaneously':
                                      lifecycleSteps.push((step): Step<void> =>
                                        Runner.runParallel(step,
                                          (innerStep: Step<void>) => { if (this.isActiveNavigation(coordinator)) { return this.removeContent(innerStep, coordinator); } },
                                          (innerStep: Step<void>) => { if (this.isActiveNavigation(coordinator)) { return this.addContent(innerStep, coordinator); } },
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 5 hrs to fix
                              packages/router/src/endpoints/viewport.ts on lines 589..596

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

                              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 'attach-detach-simultaneously':
                                      lifecycleSteps.push((step): Step<void> =>
                                        Runner.runParallel(step,
                                          (innerStep: Step<void>) => { if (this.isActiveNavigation(coordinator)) { return this.addContent(innerStep, coordinator); } },
                                          (innerStep: Step<void>) => { if (this.isActiveNavigation(coordinator)) { return this.removeContent(innerStep, coordinator); } },
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 5 hrs to fix
                              packages/router/src/endpoints/viewport.ts on lines 581..588

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

                              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 'detach-current-attach-next':
                                      lifecycleSteps.push(
                                        (step) => { if (this.isActiveNavigation(coordinator)) { return this.removeContent(step as Step<void>, coordinator); } },
                                        (step) => { if (this.isActiveNavigation(coordinator)) { return this.addContent(step as Step<void>, coordinator); } },
                                      );
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 3 hrs to fix
                              packages/router/src/endpoints/viewport.ts on lines 575..580

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

                              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 'attach-next-detach-current':
                                      lifecycleSteps.push(
                                        (step) => { if (this.isActiveNavigation(coordinator)) { return this.addContent(step as Step<void>, coordinator); } },
                                        (step) => { if (this.isActiveNavigation(coordinator)) { return this.removeContent(step as Step<void>, coordinator); } },
                                      );
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 3 hrs to fix
                              packages/router/src/endpoints/viewport.ts on lines 569..574

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

                              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 = nextContentIndex; i < ii; i++) {
                                    if (!(this.contents[0].navigation.completed ?? false)) {
                                      break;
                                    }
                                    removeable++;
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 1 hr to fix
                              packages/router/src/endpoints/viewport-scope.ts on lines 158..163

                              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

                                  [...new Set(this.scope.children.map(scope => scope.endpoint))].forEach(child => child.cancelContentChange(coordinator, noExitStep));
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 1 other location - About 1 hr to fix
                              packages/router/src/endpoints/viewport-scope.ts on lines 172..172

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (content.reloadBehavior === 'disallow') {
                                    nextContent.delete();
                                    this.contents.splice(this.contents.indexOf(nextContent), 1);
                                    return this.transitionAction = 'skip';
                                  }
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 2 other locations - About 55 mins to fix
                              packages/router/src/endpoints/viewport.ts on lines 279..283
                              packages/router/src/endpoints/viewport.ts on lines 315..319

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (nextContent.componentInstance !== null && content.componentInstance === nextContent.componentInstance) {
                                    nextContent.delete();
                                    this.contents.splice(this.contents.indexOf(nextContent), 1);
                                    return this.transitionAction = 'skip';
                                  }
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 2 other locations - About 55 mins to fix
                              packages/router/src/endpoints/viewport.ts on lines 295..299
                              packages/router/src/endpoints/viewport.ts on lines 315..319

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (this.options.stateful && content.equalParameters(nextContent)) {
                                    nextContent.delete();
                                    this.contents.splice(this.contents.indexOf(nextContent), 1);
                                    return this.transitionAction = 'skip';
                                  }
                              Severity: Major
                              Found in packages/router/src/endpoints/viewport.ts and 2 other locations - About 55 mins to fix
                              packages/router/src/endpoints/viewport.ts on lines 279..283
                              packages/router/src/endpoints/viewport.ts on lines 295..299

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

                              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