Showing 2,206 of 2,206 total issues

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

test('format', () => {
  const a = [
    ['LL', '14 Fabrairu 2010'],
    ['D MMMM YYYY', '14 Fabrairu 2010'],
  ];
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ha.test.js and 5 other locations - About 5 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 11..22

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

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

test('format', () => {
  const a = [
    ['LL', '14 የካቲት 2010'],
    ['D MMMM YYYY', '14 የካቲት 2010'],
  ];
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/am.test.js and 5 other locations - About 5 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 11..22

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

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

test('format', () => {
  const a = [
    ['LL', '14 Guraandhala 2010'],
    ['D MMMM YYYY', '14 Guraandhala 2010'],
  ];
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/om.test.js and 5 other locations - About 5 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 11..21
src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 11..22

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

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('should go to manage settings banner once manage settings button is clicked, and when reject button is clicked the banners no longer show', () => {
        getPrivacyBanner(service, variant).should('be.visible');
        getCookieBannerAmp(service, variant).should('not.be.visible');

        getPrivacyBannerAccept(service, variant).click();
Severity: Major
Found in cypress/e2e/specialFeatures/cookieBanner/testsForAMPOnly.js and 1 other location - About 5 hrs to fix
cypress/e2e/specialFeatures/cookieBanner/testsForAMPOnly.js on lines 56..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 148.

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('should go to manage settings banner once manage settings button is clicked, and when accept button is clicked the banners no longer show', () => {
        getPrivacyBanner(service, variant).should('be.visible');
        getCookieBannerAmp(service, variant).should('not.be.visible');

        getPrivacyBannerAccept(service, variant).click();
Severity: Major
Found in cypress/e2e/specialFeatures/cookieBanner/testsForAMPOnly.js and 1 other location - About 5 hrs to fix
cypress/e2e/specialFeatures/cookieBanner/testsForAMPOnly.js on lines 73..88

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

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

import moment from 'moment';
import './ky';

moment.locale('ky');

Severity: Minor
Found in src/app/legacy/psammead/psammead-locales/moment/ky.test.js - About 5 hrs to fix

    File yo.test.js has 402 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import moment from 'moment';
    import './yo';
    
    moment.locale('yo');
    
    
    Severity: Minor
    Found in src/app/legacy/psammead/psammead-locales/moment/yo.test.js - About 5 hrs to fix

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

      const japanese = {
        group: (
          <g
            fillRule="evenodd"
            stroke="#000"
      src/app/legacy/psammead/psammead-assets/src/svgs/korean.jsx on lines 5..25
      src/app/legacy/psammead/psammead-assets/src/svgs/zhongwen.jsx on lines 5..25

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

      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

      const korean = {
        group: (
          <g
            fillRule="evenodd"
            stroke="#000"
      Severity: Major
      Found in src/app/legacy/psammead/psammead-assets/src/svgs/korean.jsx and 2 other locations - About 5 hrs to fix
      src/app/legacy/psammead/psammead-assets/src/svgs/japanese.jsx on lines 5..25
      src/app/legacy/psammead/psammead-assets/src/svgs/zhongwen.jsx on lines 5..25

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

      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

      const zhongwen = {
        group: (
          <g
            fillRule="evenodd"
            stroke="#000"
      src/app/legacy/psammead/psammead-assets/src/svgs/japanese.jsx on lines 5..25
      src/app/legacy/psammead/psammead-assets/src/svgs/korean.jsx on lines 5..25

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

      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

        items: [
          {
            headlines: {
              headline: "Nothing rendered because we didn't set a strapline",
            },
      Severity: Major
      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 5 hrs to fix
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 116..153

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

      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

        items: [
          {
            headlines: {
              headline: 'Top Story 1 headline',
            },
      Severity: Major
      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 5 hrs to fix
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 169..206

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

      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('should return enabled true if a toggle is true', async () => {
          const mockToggles = {
            testToggle: {
              enabled: true,
            },
      Severity: Major
      Found in src/app/hooks/useToggle/index.test.jsx and 1 other location - About 5 hrs to fix
      src/app/hooks/useToggle/index.test.jsx on lines 31..49

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

      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('should return enabled false if a toggle is false', async () => {
          const mockToggles = {
            testToggle: {
              enabled: false,
            },
      Severity: Major
      Found in src/app/hooks/useToggle/index.test.jsx and 1 other location - About 5 hrs to fix
      src/app/hooks/useToggle/index.test.jsx on lines 10..29

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

      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(`/${service}/500 should have response code 200`, () => {
                  cy.testResponseCodeAndType({
                    path: `/${config[service].name}/500`,
                    responseCode: 200,
                    type: 'text/html',
      Severity: Major
      Found in cypress/e2e/pages/errorPage404/tests.js and 1 other location - About 5 hrs to fix
      cypress/e2e/pages/errorPage404/tests.js on lines 106..119

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

      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(`/${service}/404 should have response code 200`, () => {
                  cy.testResponseCodeAndType({
                    path: `/${config[service].name}/404`,
                    responseCode: 200,
                    type: 'text/html',
      Severity: Major
      Found in cypress/e2e/pages/errorPage404/tests.js and 1 other location - About 5 hrs to fix
      cypress/e2e/pages/errorPage404/tests.js on lines 120..133

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

      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

        7: {
          input: range(0, 7),
          expectedFirstSection: {
            firstRow: [0],
            regularRows: [[1, 2, 3, 4]],
      src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx on lines 143..165

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

      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

        6: {
          input: range(0, 6),
          expectedFirstSection: {
            firstRow: [0],
            regularRows: [[1, 2, 3, 4]],
      src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx on lines 166..188

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

      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('for tv brand page', () => {
            it('should respond with JSON', async () => {
              const { body } = await makeRequest(
                '/pashto/bbc_pashto_tv/tv_programmes/w13xttn4.json',
              );
      Severity: Major
      Found in src/server/index.test.jsx and 1 other location - About 5 hrs to fix
      src/server/index.test.jsx on lines 1038..1056

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

      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('for radio page - live radio', () => {
            it('should respond with JSON', async () => {
              const { body } = await makeRequest(
                '/korean/bbc_korean_radio/liveradio.json',
              );
      Severity: Major
      Found in src/server/index.test.jsx and 1 other location - About 5 hrs to fix
      src/server/index.test.jsx on lines 1083..1101

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

      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