aurelia/aurelia

View on GitHub

Showing 5,280 of 5,280 total issues

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

describe('3-runtime-html/lifecycle-hooks.hydrated.spec.ts', function () {

  const hookSymbol = Symbol();
  let tracker: LifeycyleTracker | null = null;

packages/__tests__/src/3-runtime-html/lifecycle-hooks.hydrating.spec.ts on lines 9..92

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

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

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

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

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

Refactorings

Further Reading

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

describe('3-runtime-html/lifecycle-hooks.hydrating.spec.ts', function () {

  const hookSymbol = Symbol();
  let tracker: LifeycyleTracker | null = null;

packages/__tests__/src/3-runtime-html/lifecycle-hooks.hydrated.spec.ts on lines 9..92

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

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

File translation-integration.spec.ts has 1490 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { I18N, I18nConfiguration, Signals } from '@aurelia/i18n';
import { Class, IContainer } from '@aurelia/kernel';
import { ISignaler, Aurelia, bindable, customElement, INode, IPlatform } from '@aurelia/runtime-html';
import { assert, PLATFORM, TestContext } from '@aurelia/testing';
import { createSpecFunction, TestExecutionContext, TestFunction } from '../../util.js';
Severity: Major
Found in packages/__tests__/src/i18n/t/translation-integration.spec.ts - About 3 days to fix

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

    class AttrInfo {
      /**
       * A lookup of the bindables of this attribute, indexed by the (pre-processed)
       * bindable names as they would be found in the attribute value.
       *
    packages/__tests__/src/3-runtime-html/template-compiler.spec.ts on lines 679..758

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

    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

      class AttrInfo {
        /**
         * A lookup of the bindables of this attribute, indexed by the (pre-processed)
         * bindable names as they would be found in the attribute value.
         *
    packages/__tests__/src/3-runtime-html/template-compiler.local-templates.spec.ts on lines 96..175

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

    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

      it('allow navigating to route defined in parent context using ../ prefix', async function () {
        @customElement({ name: 'pro-duct', template: `product \${id} <a href="../products"></a>` })
        class Product {
          id: unknown;
          public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
    Severity: Major
    Found in packages/__tests__/src/router-lite/resources/href.spec.ts and 2 other locations - About 3 days to fix
    packages/__tests__/src/router-lite/resources/load.spec.ts on lines 242..294
    packages/__tests__/src/router-lite/resources/load.spec.ts on lines 296..348

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

    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

      it('allow navigating to route defined in parent context using ../ prefix', async function () {
        @customElement({ name: 'pro-duct', template: `product \${id} <a load="../products"></a>` })
        class Product {
          id: unknown;
          public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
    Severity: Major
    Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 3 days to fix
    packages/__tests__/src/router-lite/resources/href.spec.ts on lines 8..60
    packages/__tests__/src/router-lite/resources/load.spec.ts on lines 296..348

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

    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

      it('allow navigating to route defined in parent context using ../ prefix - with parameters', async function () {
        @customElement({ name: 'pro-duct', template: `product \${id} <a load="../products"></a>` })
        class Product {
          id: unknown;
          public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
    Severity: Major
    Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 3 days to fix
    packages/__tests__/src/router-lite/resources/href.spec.ts on lines 8..60
    packages/__tests__/src/router-lite/resources/load.spec.ts on lines 242..294

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

    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

    File decorator-watch.computed.spec.ts has 1358 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { ProxyObservable } from '@aurelia/runtime';
    import {
      bindable,
      ComputedWatcher,
      customAttribute,
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/decorator-watch.computed.spec.ts - About 3 days to fix

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

        describe('`t` binding-behavior works for', function () {
          {
            @customElement({ name: 'app', template: `<span>\${'simple.text' & t}</span>` })
            class App { }
            $it('key as string literal', function ({ host, en: translation }: I18nIntegrationTestContext<App>) {
      Severity: Major
      Found in packages/__tests__/src/i18n/t/translation-integration.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/i18n/t/translation-integration.spec.ts on lines 1030..1076

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

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

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

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

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

      Refactorings

      Further Reading

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

        describe('`t` value-converter works for', function () {
          {
            @customElement({ name: 'app', template: `<span>\${'simple.text' | t}</span>` })
            class App { }
            $it('key as string literal', function ({ host, en: translation }: I18nIntegrationTestContext<App>) {
      Severity: Major
      Found in packages/__tests__/src/i18n/t/translation-integration.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/i18n/t/translation-integration.spec.ts on lines 1078..1125

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

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

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

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

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

      Refactorings

      Further Reading

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

      describe(`2-runtime/binding-behavior.spec.ts`, function () {
        let container: IContainer;
      
        beforeEach(function () {
          container = DI.createContainer();
      Severity: Major
      Found in packages/__tests__/src/2-runtime/binding-behavior.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/2-runtime/value-converter.spec.ts on lines 5..64

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

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

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

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

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

      Refactorings

      Further Reading

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

      describe(`2-runtime/value-converter.spec.ts`, function () {
        let container: IContainer;
      
        beforeEach(function () {
          container = DI.createContainer();
      Severity: Major
      Found in packages/__tests__/src/2-runtime/value-converter.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/2-runtime/binding-behavior.spec.ts on lines 5..64

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

      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

          it('transitionPlan function #3 - parent-child - parent:replace,child:invoke-lifecycles', async function () {
      
            @customElement({ name: 'ce-two', template: 'ce2 ${id1} ${id2}' })
            class CeTwo implements IRouteViewModel {
              private static id1: number = 0;
      Severity: Major
      Found in packages/__tests__/src/router-lite/smoke-tests.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 5821..5886

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

      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

          it('transitionPlan function #3 - parent-child - parent:invoke-lifecycles,child:replace', async function () {
      
            @customElement({ name: 'ce-two', template: 'ce2 ${id1} ${id2}' })
            class CeTwo implements IRouteViewModel {
              private static id1: number = 0;
      Severity: Major
      Found in packages/__tests__/src/router-lite/smoke-tests.spec.ts and 1 other location - About 3 days to fix
      packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 5754..5819

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

      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

      File controller.ts has 1268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
      import {
        AnyFunction,
        IIndexable,
        ILogger,
      Severity: Major
      Found in packages/runtime-html/src/templating/controller.ts - About 3 days to fix

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

        export class UserState {
          errors: ErrorList = [];
          current = User.NONE;
          isAuth = false;
        
        
        Severity: Major
        Found in examples/realworld/src/state.ts and 1 other location - About 3 days to fix
        examples/realworld-conventions/src/state.ts on lines 11..78

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

        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 class UserState {
          errors: ErrorList = [];
          current = User.NONE;
          isAuth = false;
        
        
        Severity: Major
        Found in examples/realworld-conventions/src/state.ts and 1 other location - About 3 days to fix
        examples/realworld/src/state.ts on lines 9..76

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

        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

          it('correctly analyzes ce_a_b_default', function () {
            const loader = createFixture();
        
            const res = loader.load(ce_a_b_default);
        
        
        Severity: Major
        Found in packages/__tests__/src/1-kernel/module-loader.spec.ts and 1 other location - About 3 days to fix
        packages/__tests__/src/1-kernel/module-loader.spec.ts on lines 52..80

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

        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

          it('correctly analyzes ce_a_b_defaultb', function () {
            const loader = createFixture();
        
            const res = loader.load(ce_a_b_defaultb);
        
        
        Severity: Major
        Found in packages/__tests__/src/1-kernel/module-loader.spec.ts and 1 other location - About 3 days to fix
        packages/__tests__/src/1-kernel/module-loader.spec.ts on lines 22..50

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

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language