Showing 2,206 of 2,206 total issues

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

  describe('fromNow', () => {
    assert.equal(
      moment().add({ s: 30 }).fromNow(),
      '幾秒後',
      'in a few seconds'
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 309..316
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 307..314
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 197..204
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 296..303
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 330..337
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 289..296
src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 354..365
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 262..269
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 331..338
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 267..274
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 300..311
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 300..307

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

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

test('fromNow', () => {
  assert.equal(
    moment().add({ s: 30 }).fromNow(),
    'na ntabịanya ole na ole',
    'in a few seconds'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ig.test.js and 22 other locations - About 2 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 309..316
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 307..314
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 197..204
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 296..303
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 330..337
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 289..296
src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 354..365
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 262..269
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 331..338
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 267..274
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 300..311
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 297..304

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

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

test('fromNow', () => {
  assert.equal(
    moment().add({ s: 30 }).fromNow(),
    'en unos segundos',
    'en unos segundos'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/es.test.js and 22 other locations - About 2 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 309..316
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 307..314
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 197..204
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 296..303
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 330..337
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 289..296
src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 354..365
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 262..269
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 331..338
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 267..274
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 300..311
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 297..304

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

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

test('fromNow', () => {
  assert.equal(
    moment().add({ s: 30 }).fromNow(),
    'තත්පර කිහිපයකින්',
    'in a few seconds'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/si.test.js and 22 other locations - About 2 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 309..316
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 307..314
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 197..204
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 297..304
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 303..310
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 296..303
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 298..301
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 330..337
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 289..296
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 298..305
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 354..365
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 262..269
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 331..338
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 267..274
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 300..311
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 300..307
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 297..304

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

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

  it('logger.debug should run console.debug in development', () => {
    const loggerInstance = loggerWeb('');
    loggerInstance.debug(event, message);

    expect(global.console.debug).toHaveBeenCalledWith({ event, message });
Severity: Major
Found in src/app/lib/logger.web.test.js and 6 other locations - About 2 hrs to fix
src/app/lib/logger.web.test.js on lines 25..31
src/app/lib/logger.web.test.js on lines 75..81
src/app/lib/logger.web.test.js on lines 83..89
src/app/lib/logger.web.test.js on lines 91..97
src/app/lib/logger.web.test.js on lines 107..113
src/app/lib/logger.web.test.js on lines 115..121

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

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

  it('logger.silly should run console.log in development', () => {
    const loggerInstance = loggerWeb('');
    loggerInstance.silly(event, message);

    expect(global.console.log).toHaveBeenCalledWith({ event, message });
Severity: Major
Found in src/app/lib/logger.web.test.js and 6 other locations - About 2 hrs to fix
src/app/lib/logger.web.test.js on lines 25..31
src/app/lib/logger.web.test.js on lines 75..81
src/app/lib/logger.web.test.js on lines 83..89
src/app/lib/logger.web.test.js on lines 91..97
src/app/lib/logger.web.test.js on lines 99..105
src/app/lib/logger.web.test.js on lines 107..113

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

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

  it('should correctly render canonical navigation on non-navigation page', () => {
    const { container } = render(<Navigation />, {
      bbcOrigin: 'https://www.test.bbc.co.uk',
      id: 'c0000000000o',
      isAmp: false,
Severity: Major
Found in src/app/legacy/containers/Navigation/index.test.jsx and 5 other locations - About 2 hrs to fix
src/app/legacy/containers/Navigation/index.test.jsx on lines 13..24
src/app/legacy/containers/Navigation/index.test.jsx on lines 26..37
src/app/legacy/containers/Navigation/index.test.jsx on lines 39..50
src/app/legacy/containers/Navigation/index.test.jsx on lines 52..63
src/app/legacy/containers/Navigation/index.test.jsx on lines 65..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 87.

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 null when toggle is disabled', () => {
      const { container } = render(
        <ContextWrap
          platform="amp"
          pageType={ARTICLE_PAGE}
Severity: Major
Found in src/app/legacy/containers/ComscoreAnalytics/index.test.jsx and 1 other location - About 2 hrs to fix
src/app/legacy/containers/ComscoreAnalytics/index.test.jsx on lines 101..114

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

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

const Twitter = ({ id }) => (
  <>
    <Helmet>
      <script
        async
src/app/legacy/psammead/psammead-social-embed/src/Amp/index.jsx on lines 36..47

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

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

      links={[
        {
          linkUrl: 'https://bbc.com',
          linkText: 'Apple',
          linkType: 'apple',
src/app/routes/onDemandAudio/tempData/podcastExternalLinks/hindi.js on lines 157..185

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

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 null when toggle is disabled', async () => {
      const { container } = render(
        <ContextWrap
          platform="canonical"
          pageType={ARTICLE_PAGE}
Severity: Major
Found in src/app/legacy/containers/ComscoreAnalytics/index.test.jsx and 1 other location - About 2 hrs to fix
src/app/legacy/containers/ComscoreAnalytics/index.test.jsx on lines 56..69

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

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

const YouTube = ({ id }) => (
  <>
    <Helmet>
      <script
        async
src/app/legacy/psammead/psammead-social-embed/src/Amp/index.jsx on lines 23..34

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

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

    p0c0530h: [
      {
        linkText: 'Spotify',
        linkUrl: 'https://open.spotify.com/show/02iGEmdv3do4InPguSE1cs',
        linkType: 'spotify',
src/app/legacy/containers/PodcastExternalLinks/index.stories.jsx on lines 14..40

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

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 collectResults has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const collectResults = async (link, service, type) => {
  await fetchWithCert(link).then(response => {
    if (response.ok) {
      response.json().then(json => {
        const jsondata = 'data' in json ? json.data : json;
Severity: Major
Found in scripts/mostReadCollectionTimes.js - About 2 hrs to fix

    Function Promo has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Promo = () => {
      const { podcastPromo, script, service, dir } = useContext(ServiceContext);
    
      const {
        podcastPromoTitle,
    Severity: Major
    Found in src/app/legacy/containers/PodcastPromo/SecondaryColumn.jsx - About 2 hrs to fix

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

        it('should correctly render privacy banner - RTL layout', () => {
          const { container } = render(
            <Banner type="privacy" onAccept={() => {}} onReject={() => {}} />,
            {
              service: 'arabic',
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 6..14
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 26..34
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 36..44

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

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

        it('should correctly render cookie banner - RTL layout', () => {
          const { container } = render(
            <Banner type="cookie" onAccept={() => {}} onReject={() => {}} />,
            {
              service: 'arabic',
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 6..14
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 16..24
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 26..34

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

      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 expectedWebpSrcSetURLs = [
              `https://ichef.test.bbci.co.uk/ace/ws/70${path}.webp 70w`,
              `https://ichef.test.bbci.co.uk/ace/ws/95${path}.webp 95w`,
              `https://ichef.test.bbci.co.uk/ace/ws/144${path}.webp 144w`,
              `https://ichef.test.bbci.co.uk/ace/ws/183${path}.webp 183w`,
      Severity: Major
      Found in src/app/pages/FrontPage/index.test.jsx and 2 other locations - About 2 hrs to fix
      src/app/pages/FeatureIdxPage/index.test.jsx on lines 176..184
      src/app/pages/FrontPage/index.test.jsx on lines 198..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 86.

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

        it('should correctly render privacy banner - LTR layout', () => {
          const { container } = render(
            <Banner type="privacy" onAccept={() => {}} onReject={() => {}} />,
            {
              service: 'news',
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 16..24
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 26..34
      src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx on lines 36..44

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

      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 expectedJPGSrcSetURLs = [
              `https://ichef.test.bbci.co.uk/ace/ws/70${path} 70w`,
              `https://ichef.test.bbci.co.uk/ace/ws/95${path} 95w`,
              `https://ichef.test.bbci.co.uk/ace/ws/144${path} 144w`,
              `https://ichef.test.bbci.co.uk/ace/ws/183${path} 183w`,
      Severity: Major
      Found in src/app/pages/FrontPage/index.test.jsx and 2 other locations - About 2 hrs to fix
      src/app/pages/FeatureIdxPage/index.test.jsx on lines 176..184
      src/app/pages/FrontPage/index.test.jsx on lines 188..196

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

      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