Showing 2,206 of 2,206 total issues

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

            s = function(e, t) {
                var n,
                    r,
                    o,
                    i,
Severity: Major
Found in public/vendor/cwr.js and 7 other locations - About 5 days to fix
public/vendor/cwr.js on lines 1485..1574
public/vendor/cwr.js on lines 1643..1732
public/vendor/cwr.js on lines 1841..1930
public/vendor/cwr.js on lines 3290..3379
public/vendor/cwr.js on lines 3586..3675
public/vendor/cwr.js on lines 4825..4914
public/vendor/cwr.js on lines 4983..5072

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

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

            O = function(e, t) {
                var n,
                    r,
                    o,
                    i,
Severity: Major
Found in public/vendor/cwr.js and 7 other locations - About 5 days to fix
public/vendor/cwr.js on lines 1107..1196
public/vendor/cwr.js on lines 1485..1574
public/vendor/cwr.js on lines 1841..1930
public/vendor/cwr.js on lines 3290..3379
public/vendor/cwr.js on lines 3586..3675
public/vendor/cwr.js on lines 4825..4914
public/vendor/cwr.js on lines 4983..5072

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

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

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

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

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

Refactorings

Further Reading

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

        function Se(e, t) {
            var n,
                r,
                o,
                i,
Severity: Major
Found in public/vendor/cwr.js and 1 other location - About 5 days to fix
public/vendor/cwr.js on lines 494..583

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

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

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

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

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

Refactorings

Further Reading

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

                function d(e, t) {
                    var n,
                        r,
                        o,
                        i,
Severity: Major
Found in public/vendor/cwr.js and 1 other location - About 5 days to fix
public/vendor/cwr.js on lines 2520..2609

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

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 index.test.jsx has 1537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import request from 'supertest';
import * as reactDomServer from 'react-dom/server';
import dotenv from 'dotenv';
import getRouteProps from '#app/routes/utils/fetchPageData/utils/getRouteProps';
Severity: Major
Found in src/server/index.test.jsx - About 4 days to fix

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

    test('calendar last week', () => {
      let i;
      let m;
      let now;
    
    
    Severity: Major
    Found in src/app/legacy/psammead/psammead-locales/moment/ru.test.js and 1 other location - About 3 days to fix
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 522..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 647.

    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

    test('calendar next week', () => {
      let i;
      let m;
      let now;
    
    
    Severity: Major
    Found in src/app/legacy/psammead/psammead-locales/moment/ru.test.js and 1 other location - About 3 days to fix
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 596..668

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

    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 fixtureData.js has 1328 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export const threeLinks = [
      {
        id: '65244df2',
        type: 'title',
        model: {
    Severity: Major
    Found in src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js - About 3 days to fix

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

          it.each`
            ichefSubdomain    | originCode     | locator                                                                                              | expectedURL
            ${undefined}      | ${'cpsprodpb'} | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsprodpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp`}
            ${undefined}      | ${'cpsprodpb'} | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.png'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsprodpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.png.webp`}
            ${undefined}      | ${'cpsdevpb'}  | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsdevpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp`}
      Severity: Major
      Found in src/app/lib/utilities/ichefURL/index.test.js and 1 other location - About 3 days to fix
      src/app/lib/utilities/ichefURL/index.test.js on lines 70..101

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

      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.each`
            ichefSubdomain    | originCode     | locator                                                                                                   | expectedURL
            ${undefined}      | ${'cpsprodpb'} | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsprodpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp`}
            ${undefined}      | ${'cpsprodpb'} | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.png.webp'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsprodpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.png.webp`}
            ${undefined}      | ${'cpsdevpb'}  | ${'cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp'}                                              | ${`${BASE_IMAGE_URL}/ace/ws/660/cpsdevpb/cc66/live/5b34d420-b382-11e9-b6fd-e3056fffd1f1.jpg.webp`}
      Severity: Major
      Found in src/app/lib/utilities/ichefURL/index.test.js and 1 other location - About 3 days to fix
      src/app/lib/utilities/ichefURL/index.test.js on lines 19..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 525.

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

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

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

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

      Refactorings

      Further Reading

      Function r has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
      Open

      var r = (function () {
          var r = 5,
            n = 8 - r,
            o = 1e3;
          function e(t, n, o) {
      Severity: Minor
      Found in src/app/hooks/useImageColour/colorthief.js - About 2 days to fix

      Cognitive Complexity

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

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

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

      Further reading

      File buildParams.test.ts has 1067 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { TOPIC_PAGE } from '#app/routes/utils/pageTypes';
      import * as analyticsUtils from '#lib/analyticsUtils';
      import { RequestContextProps } from '../../../../contexts/RequestContext';
      import { ServiceConfig } from '../../../../models/types/serviceConfig';
      import { buildPageATIParams, buildPageATIUrl } from './buildParams';
      Severity: Major
      Found in src/app/components/ATIAnalytics/params/genericPage/buildParams.test.ts - About 2 days to fix

        File index.test.tsx has 1043 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { Helmet } from 'react-helmet';
        import {
          ARTICLE_PAGE,
          FRONT_PAGE,
        Severity: Major
        Found in src/app/components/Metadata/index.test.tsx - About 2 days to fix

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

            {
              id: '917068ee',
              type: 'link',
              model: {
                locator: 'urn:bbc:cps:curie:asset:b5c53243-a695-e059-e040-850a02846523',
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 39..147
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 896..1004

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

          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

            {
              id: '9f20a126',
              type: 'link',
              model: {
                locator: 'urn:bbc:content:url-promo:https%3A%2F%2Fwww.bbc.co.uk%2Fpidgin',
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 787..895
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 896..1004

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

          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

            {
              id: 'ba2f138e',
              type: 'link',
              model: {
                locator: 'urn:bbc:content:url-promo:https%3A%2F%2Fwww.bbc.co.uk%2Fmundo',
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 39..147
          src/app/legacy/components/ScrollablePromo/helpers/fixtureData.js on lines 787..895

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

          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 index.test.tsx has 978 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable no-template-curly-in-string */
          import React from 'react';
          import { articleDataNews } from '#pages/ArticlePage/fixtureData';
          import { data as fixData } from '#data/afrique/cpsAssets/48465371.json';
          import styUkrainianAssetData from '#data/ukrainian/cpsAssets/news-53561143.json';
          Severity: Major
          Found in src/app/components/ATIAnalytics/index.test.tsx - About 2 days to fix

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

            test('from', () => {
              const start = moment([2007, 1, 28]);
            
              assert.equal(
                start.from(moment([2007, 1, 28]).add({ s: 45 }), true),
            Severity: Major
            Found in src/app/legacy/psammead/psammead-locales/moment/rw.test.js and 6 other locations - About 2 days to fix
            src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ps.test.js on lines 27..74
            src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 24..72

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 424.

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

            test('from', () => {
              const start = moment([2007, 1, 28]);
            
              assert.equal(
                start.from(moment([2007, 1, 28]).add({ s: 45 }), true),
            Severity: Major
            Found in src/app/legacy/psammead/psammead-locales/moment/ti.test.js and 6 other locations - About 2 days to fix
            src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ps.test.js on lines 27..74
            src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 23..71

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

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

            test('from', () => {
              const start = moment([2007, 1, 28]);
            
              assert.equal(
                start.from(moment([2007, 1, 28]).add({ s: 45 }), true),
            Severity: Major
            Found in src/app/legacy/psammead/psammead-locales/moment/so.test.js and 6 other locations - About 2 days to fix
            src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 23..70
            src/app/legacy/psammead/psammead-locales/moment/ps.test.js on lines 27..74
            src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 23..71
            src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 24..72

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 424.

            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