Showing 2,206 of 2,206 total issues

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

test('from', () => {
  const start = moment([2007, 1, 28]);

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 424.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 424.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 424.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 424.

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

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

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

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

Refactorings

Further Reading

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

export default () => {
  it('I can see the brand title', () => {
    const brandTitleEl = document.querySelector('h1 span span:first-child');

    expect(brandTitleEl).toBeInTheDocument();
Severity: Major
Found in src/integration/pages/onDemandAudioPage/commonEpisodeTests.js and 1 other location - About 2 days to fix
src/integration/pages/podcastPage/commonEpisodeTests.js on lines 1..45

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

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

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

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

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

Refactorings

Further Reading

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

export default () => {
  it('I can see the brand title', () => {
    const brandTitleEl = document.querySelector('h1 span span:first-child');

    expect(brandTitleEl).toBeInTheDocument();
Severity: Major
Found in src/integration/pages/podcastPage/commonEpisodeTests.js and 1 other location - About 2 days to fix
src/integration/pages/onDemandAudioPage/commonEpisodeTests.js on lines 1..45

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

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

  describe(`Images`, () => {
    it('should have a picture tag around images', () => {
      cy.get('img').each($img => {
        const $section = $img.parents('section');
        if ($section.length > 0) {
Severity: Major
Found in cypress/e2e/pages/homePage/testsForCanonicalOnly.js and 1 other location - About 2 days to fix
cypress/e2e/pages/frontPage/testsForCanonicalOnly.js on lines 6..42

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

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

  describe(`Images`, () => {
    it('should have a picture tag around images', () => {
      cy.get('img').each($img => {
        const $section = $img.parents('section');
        if ($section.length > 0) {
Severity: Major
Found in cypress/e2e/pages/frontPage/testsForCanonicalOnly.js and 1 other location - About 2 days to fix
cypress/e2e/pages/homePage/testsForCanonicalOnly.js on lines 5..41

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

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 rowsTest = value => {
  describe('first section', () => {
    it(`should correctly split ${value} stories`, () => {
      const items = numberOfStories[value].input;
      const isFirstSection = true;
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 134..172

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

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 allowedItemsTest = value => {
  describe('first section', () => {
    it(`should return correct allowed items for ${value} stories`, () => {
      const items = numberOfStories[value].input;
      const isFirstSection = true;
src/app/legacy/containers/IndexPageSection/utilities/storyRowsSplitter.test.jsx on lines 475..513

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

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

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

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

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

Refactorings

Further Reading

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

test('meridiem', () => {
  assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात', 'before dawn');
  assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सुबह', 'morning');
  assert.equal(
    moment([2011, 2, 23, 14, 30]).format('a'),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/hi.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

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

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

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

Refactorings

Further Reading

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

test('meridiem invariant', () => {
  assert.equal(
    moment([2011, 2, 23, 2, 30]).format('a'),
    ' வைகறை',
    'before dawn'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ta.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141

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

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

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

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

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

Refactorings

Further Reading

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

test('meridiem', () => {
  assert.equal(
    moment([2011, 2, 23, 2, 30]).format('a'),
    'पहाटे',
    'before dawn'
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/mr.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

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

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

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

Refactorings

Further Reading

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

test('meridiem invariant', () => {
  assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'ਰਾਤ', 'before dawn');
  assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'ਸਵੇਰ', 'morning');
  assert.equal(
    moment([2011, 2, 23, 14, 30]).format('a'),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

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

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

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

Refactorings

Further Reading

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

test('meridiem', () => {
  assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'রাত', 'before dawn');
  assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'সকাল', 'morning');
  assert.equal(
    moment([2011, 2, 23, 14, 30]).format('a'),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/bn.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

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

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

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

Refactorings

Further Reading

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

test('meridiem', () => {
  assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'राति', 'before dawn');
  assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'बिहान', 'morning');
  assert.equal(
    moment([2011, 2, 23, 14, 30]).format('a'),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ne.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 403..429
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

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

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

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

Refactorings

Further Reading

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

test('meridiem', () => {
  assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'રાત', 'before dawn');
  assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'સવાર', 'morning');
  assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'બપોર', 'during day');
  assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'સાંજ', 'evening');
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/gu.test.js and 6 other locations - About 2 days to fix
src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 306..336
src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 404..434
src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 409..455
src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 402..432
src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 111..141
src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 111..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 385.

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

import Cookie from 'js-cookie';
import onClient from '../../../lib/utilities/onClient';
import {
  ARTICLE_PAGE,
  FRONT_PAGE,
Severity: Major
Found in src/app/components/ChartbeatAnalytics/utils/index.test.ts - About 2 days to fix

    Function pageLayout has 423 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const pageLayout = () => {
      return (
        <>
          <ATIAnalytics atiData={atiAnalytics} />
          <ChartbeatAnalytics title={pageTitle} />
    Severity: Major
    Found in ws-nextjs-app/pages/ws/languages.page.tsx - About 2 days to fix

      Function 655 has 416 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  655: function(e, t, n) {
                      "use strict";
                      n.r(t),
                      n.d(t, {
                          __extends: function() {
      Severity: Major
      Found in public/vendor/cwr.js - About 2 days to fix
        Severity
        Category
        Status
        Source
        Language