Showing 2,206 of 2,206 total issues

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

test('weeks year starting sunday format', () => {
  assert.equal(
    moment([2011, 11, 26]).format('w ww wo'),
    '1 01 1',
    'Dec 26 2011 should be week 1'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/sw.test.js and 24 other locations - About 6 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 415..441

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

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

test('weeks year starting sunday formatted', () => {
  assert.equal(
    moment([2011, 11, 26]).format('w ww wo'),
    '५३ ५३ ५३',
    'Dec 26 2011 should be week 53'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ne.test.js and 24 other locations - About 6 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 415..441

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

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

test('weeks year starting sunday formatted', () => {
  assert.equal(
    moment([2012, 0, 1]).format('w ww wo'),
    '1 01 1',
    'Jan  1 2012 should be week 1'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/hi.test.js and 24 other locations - About 6 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 415..441

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

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

  describe('weeks year starting sunday formatted', () => {
    assert.equal(
      moment([2012, 0, 1]).format('w ww wo'),
      '1 01 1週',
      'Jan  1 2012 應該是第 1週'
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436

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

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

test('weeks year starting sunday formatted', () => {
  assert.equal(
    moment([2012, 0, 1]).format('w ww wo'),
    '52 52 Nke 52',
    'Jan  1 2012 should be week 52'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ig.test.js and 24 other locations - About 6 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 415..441

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

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

test('weeks year starting sunday formatted', () => {
  assert.equal(
    moment([2012, 0, 1]).format('w ww wo'),
    '১ ০১ ১',
    'Jan  1 2012 should be week 1'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/bn.test.js and 24 other locations - About 6 hrs to fix
src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 409..435
src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436
src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 415..441

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

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

export const custom = {
  alt: 'By Elisa Decker, from her series "Sidewalk"',
  attribution: 'Elisa Decker',
  sizes: '100vw',
  src: customImageUrl.replace('[WIDTH]', sizes[0]),
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 7..22
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 24..39
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 41..56

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

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

export const portrait = {
  alt: 'Map of the UK displaying Syrian refugees and asylum seekers per 10000 population. Ranges from 0 to 17.',
  attribution: 'BBC',
  sizes: '100vw',
  src: portraitImageUrl.replace('[WIDTH]', sizes[0]),
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 7..22
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 41..56
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 58..73

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

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

export const square = {
  alt: 'Tracks through the snow',
  attribution: 'BBC',
  sizes: '100vw',
  src: squareImageUrl.replace('[WIDTH]', sizes[0]),
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 7..22
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 24..39
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 58..73

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

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

export const landscape = {
  alt: 'Student sitting an exam',
  attribution: '',
  sizes: '100vw',
  src: landscapeImageUrl.replace('[WIDTH]', sizes[0]),
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 24..39
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 41..56
src/app/legacy/psammead/psammead-image/src/testHelpers/fixtureData.js on lines 58..73

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

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

import moment from 'moment';
import './sw';

moment.locale('sw');

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

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

      it('should request BFF data when the app env is "test"', async () => {
        process.env.SIMORGH_APP_ENV = 'test';
    
        const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
        fetchDataSpy.mockImplementation(() =>
    Severity: Major
    Found in src/app/routes/mostRead/getInitialData/index.test.js and 3 other locations - About 6 hrs to fix
    src/app/routes/mostRead/getInitialData/index.test.js on lines 83..109
    src/app/routes/mostRead/getInitialData/index.test.js on lines 111..137
    src/app/routes/mostRead/getInitialData/index.test.js on lines 139..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 157.

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

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

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

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

    Refactorings

    Further Reading

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

    const fetchWithCert = async (url, options) => {
      const caPath = process.env.CA_PATH || '/etc/pki/tls/certs/ca-bundle.crt';
      const certChainPath =
        process.env.CERT_CHAIN_PATH || '/etc/pki/tls/certs/client.crt';
      const keyPath = process.env.KEY_PATH || '/etc/pki/tls/private/client.key';
    Severity: Major
    Found in scripts/mostReadCollectionTimes.js and 1 other location - About 6 hrs to fix
    scripts/mostReadAndWatchedCollectionData.js on lines 30..54

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

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

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

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

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

    Refactorings

    Further Reading

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

    const fetchWithCert = async (url, options) => {
      const caPath = process.env.CA_PATH || '/etc/pki/tls/certs/ca-bundle.crt';
      const certChainPath =
        process.env.CERT_CHAIN_PATH || '/etc/pki/tls/certs/client.crt';
      const keyPath = process.env.KEY_PATH || '/etc/pki/tls/private/client.key';
    Severity: Major
    Found in scripts/mostReadAndWatchedCollectionData.js and 1 other location - About 6 hrs to fix
    scripts/mostReadCollectionTimes.js on lines 30..54

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

    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 request BFF data when the app env is "live"', async () => {
        process.env.SIMORGH_APP_ENV = 'live';
    
        const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
        fetchDataSpy.mockImplementation(() =>
    Severity: Major
    Found in src/app/routes/mostRead/getInitialData/index.test.js and 3 other locations - About 6 hrs to fix
    src/app/routes/mostRead/getInitialData/index.test.js on lines 55..81
    src/app/routes/mostRead/getInitialData/index.test.js on lines 111..137
    src/app/routes/mostRead/getInitialData/index.test.js on lines 139..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 157.

    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 request BFF data if "renderer_env=test" is supplied in the path, ignoring the app env', async () => {
        process.env.SIMORGH_APP_ENV = 'local';
    
        const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
        fetchDataSpy.mockImplementation(() =>
    Severity: Major
    Found in src/app/routes/mostRead/getInitialData/index.test.js and 3 other locations - About 6 hrs to fix
    src/app/routes/mostRead/getInitialData/index.test.js on lines 55..81
    src/app/routes/mostRead/getInitialData/index.test.js on lines 83..109
    src/app/routes/mostRead/getInitialData/index.test.js on lines 139..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 157.

    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 request BFF data if "renderer_env=live" is supplied in the path, ignoring the app env', async () => {
        process.env.SIMORGH_APP_ENV = 'local';
    
        const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
        fetchDataSpy.mockImplementation(() =>
    Severity: Major
    Found in src/app/routes/mostRead/getInitialData/index.test.js and 3 other locations - About 6 hrs to fix
    src/app/routes/mostRead/getInitialData/index.test.js on lines 55..81
    src/app/routes/mostRead/getInitialData/index.test.js on lines 83..109
    src/app/routes/mostRead/getInitialData/index.test.js on lines 111..137

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

    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('Index Alsos', () => {
      it('should render multiple correctly', () => {
        const { container } = render(
          <IndexAlsosContainer
            alsoItems={relatedItems}
    src/app/legacy/containers/IndexPageSection/UsefulLinks/index.test.jsx on lines 7..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 157.

    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('Useful links', () => {
      it('should render multiple correctly', () => {
        const { container } = render(
          <UsefulLinksComponent
            items={usefulItems}
    src/app/legacy/psammead/psammead-story-promo/src/IndexAlsos/index.test.jsx on lines 7..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 157.

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

    /* eslint-disable no-console */
    import React from 'react';
    import { suppressPropWarnings } from '#psammead/psammead-test-helpers/src';
    import {
      render,
    Severity: Minor
    Found in src/app/legacy/psammead/psammead-social-embed/src/index.test.jsx - About 6 hrs to fix
      Severity
      Category
      Status
      Source
      Language