Showing 2,206 of 2,206 total issues

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

  2: {
    input: range(0, 2),
    expectedFrontSectionAllowedItems: range(0, 2),
    expectedNotFrontSectionAllowedItems: range(0, 2),
    expectedShowAllPromosAllowedItems: range(0, 2),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  9: {
    input: range(0, 9),
    expectedFrontSectionAllowedItems: range(0, 9),
    expectedNotFrontSectionAllowedItems: range(0, 9),
    expectedShowAllPromosAllowedItems: range(0, 9),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  14: {
    input: range(0, 14),
    expectedFrontSectionAllowedItems: range(0, 13),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 14),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

it('should return an empty string if given an empty string', () => {
  const actual = camelCaseToText('');
  const expected = '';

  expect(actual).toEqual(expected);
Severity: Major
Found in src/integration/utils/camelCaseToText.test.js and 4 other locations - About 35 mins to fix
src/integration/utils/camelCaseToText.test.js on lines 3..8
src/integration/utils/getPageTypeFromTestPath.test.js on lines 3..10
src/integration/utils/getPageTypeFromTestPath.test.js on lines 12..19
src/integration/utils/getPageTypeFromTestPath.test.js on lines 21..28

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

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

it('should get the page type from integration test paths for lite', () => {
  const actual = getPageTypeFromTestPath(
    'src/integration/pages/articles/pidgin/canonical.test.js',
  );
  const expected = 'articles';
Severity: Major
Found in src/integration/utils/getPageTypeFromTestPath.test.js and 4 other locations - About 35 mins to fix
src/integration/utils/camelCaseToText.test.js on lines 3..8
src/integration/utils/camelCaseToText.test.js on lines 10..15
src/integration/utils/getPageTypeFromTestPath.test.js on lines 3..10
src/integration/utils/getPageTypeFromTestPath.test.js on lines 12..19

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

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

it('should convert camel case to text with spaces between words', () => {
  const actual = camelCaseToText('someCamelCaseExample');
  const expected = 'Some Camel Case Example';

  expect(actual).toEqual(expected);
Severity: Major
Found in src/integration/utils/camelCaseToText.test.js and 4 other locations - About 35 mins to fix
src/integration/utils/camelCaseToText.test.js on lines 10..15
src/integration/utils/getPageTypeFromTestPath.test.js on lines 3..10
src/integration/utils/getPageTypeFromTestPath.test.js on lines 12..19
src/integration/utils/getPageTypeFromTestPath.test.js on lines 21..28

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

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

it('should get the page type from integration test paths for amp', () => {
  const actual = getPageTypeFromTestPath(
    'src/integration/pages/articles/pidgin/amp.test.js',
  );
  const expected = 'articles';
Severity: Major
Found in src/integration/utils/getPageTypeFromTestPath.test.js and 4 other locations - About 35 mins to fix
src/integration/utils/camelCaseToText.test.js on lines 3..8
src/integration/utils/camelCaseToText.test.js on lines 10..15
src/integration/utils/getPageTypeFromTestPath.test.js on lines 12..19
src/integration/utils/getPageTypeFromTestPath.test.js on lines 21..28

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

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

it('should get the page type from integration test paths for canonical', () => {
  const actual = getPageTypeFromTestPath(
    'src/integration/pages/liveRadio/pidgin/canonical.test.js',
  );
  const expected = 'liveRadio';
Severity: Major
Found in src/integration/utils/getPageTypeFromTestPath.test.js and 4 other locations - About 35 mins to fix
src/integration/utils/camelCaseToText.test.js on lines 3..8
src/integration/utils/camelCaseToText.test.js on lines 10..15
src/integration/utils/getPageTypeFromTestPath.test.js on lines 3..10
src/integration/utils/getPageTypeFromTestPath.test.js on lines 21..28

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

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

              <OptionsItem className="hide" script={script} service={service}>
                <div>{hide}</div>
              </OptionsItem>
Severity: Minor
Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 343..345
src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 245..247

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

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

  it.each`
    enabled      | value                | expected | description
    ${0}         | ${'most-read'}       | ${false} | ${'non-boolean value for enabled and same component name'}
    ${0}         | ${'related-content'} | ${false} | ${'non-boolean value for enabled and different component name'}
    ${1}         | ${'most-read'}       | ${false} | ${'non-boolean truthy value for enabled and same component name'}
Severity: Minor
Found in src/app/hooks/useTrackingToggle/index.test.jsx and 1 other location - About 35 mins to fix
src/app/hooks/useTrackingToggle/index.test.jsx on lines 22..39

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

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

      expect(linkLevelTrackingItem3).toEqual({
        campaignID: 'cps_wsoj',
        componentName:
          'Nigeria%3A%20Wetin%205%2C222%20megawatts%20electric%20fit%20do%3F',
        format: 'CHD=promo::3',
src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx on lines 80..88
src/app/legacy/containers/CpsRecommendations/RecommendationsPromoList/index.test.jsx on lines 94..102

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

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

    shouldMatchSnapshot(
      'should render correctly for canonical',
      <Wrapper service="news">
        <IndexPageSection group={group} sectionNumber={0} />
      </Wrapper>,
Severity: Minor
Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 394..399
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 408..413

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

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

    shouldMatchSnapshot(
      'should render with only one item',
      <Wrapper service="news">
        <IndexPageSection group={hasOneItem} sectionNumber={0} />
      </Wrapper>,
Severity: Minor
Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 387..392
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 394..399

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

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

  it('should no-op when no groups', () => {
    const data = {
      content: {},
    };

src/app/routes/utils/sharedDataTransformers/filterEmptyGroupItems/index.test.js on lines 35..40
src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 163..169

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

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

  gujarati: {
    articles: 'Sept 2019',
    frontPage: '13th Jan 2020',
    mediaAssetPage: '6th Feb 2020',
    photoGalleryPage: '18th Feb 2020',
Severity: Major
Found in scripts/releaseInfo/launchDates.js and 3 other locations - About 35 mins to fix
scripts/releaseInfo/launchDates.js on lines 180..189
scripts/releaseInfo/launchDates.js on lines 351..360
scripts/releaseInfo/launchDates.js on lines 411..420

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

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

    shouldMatchSnapshot(
      'should render correctly with a linking strapline',
      <Wrapper service="news">
        <IndexPageSection group={groupWithLink} sectionNumber={2} />
      </Wrapper>,
Severity: Minor
Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 387..392
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 408..413

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

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 ResponsivePodcastPromoWrapper = styled.div`
  ${({ dir }) => (dir === 'rtl' ? 'float: left;' : 'float: right;')}

  margin: 0  ${GEL_SPACING} ${GEL_SPACING_TRPL};
  height: auto;
Severity: Minor
Found in src/app/legacy/containers/PodcastPromo/Inline.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 205..226
src/app/lib/analyticsUtils/index.test.js on lines 562..571

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

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 ContentWrapper = styled.div`
  align-self: center;
  max-height: ${BANNER_MAX_HEIGHT};
  max-width: ${GEL_GROUP_2_SCREEN_WIDTH_MAX};
  overflow-y: auto;
Severity: Minor
Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/PodcastPromo/Inline.jsx on lines 42..61
src/app/lib/analyticsUtils/index.test.js on lines 562..571

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

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

      <Grid
        columns={{
          group0: 6,
          group1: 6,
          group2: 6,
Severity: Minor
Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx and 2 other locations - About 35 mins to fix
src/app/legacy/containers/CpsRecommendations/RecommendationsPromo/index.jsx on lines 106..134
src/app/pages/MostReadPage/MostReadPage.jsx on lines 50..82

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

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

  test.each`
    qsValue                   | expected
    ${'?at_medium=email'}     | ${'email'}
    ${'?at_medium=affiliate'} | ${'affiliate'}
    ${'?at_medium=custom123'} | ${'custom123'}
Severity: Minor
Found in src/app/lib/analyticsUtils/index.test.js and 2 other locations - About 35 mins to fix
src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 205..226
src/app/legacy/containers/PodcastPromo/Inline.jsx on lines 42..61

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

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