Showing 2,206 of 2,206 total issues

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

      it('should all be in the document', () => {
        expect(embedErrorMessages).toBeTruthy();
        expect(embedErrorMessages.length).toEqual(5);
      });
Severity: Minor
Found in src/integration/common/flourishEmbed.amp.js and 1 other location - About 35 mins to fix
src/integration/common/flourishEmbed.canonical.js on lines 8..11

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

      {sectionBody({
        group,
        items: allowedItems,
        script,
        service,
Severity: Minor
Found in src/app/legacy/containers/IndexPageSection/index.jsx and 1 other location - About 35 mins to fix
src/server/index.jsx on lines 225..234

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

  <ThemeProvider service="news">
    <InlineLinkContainer
      locator={locator}
      blocks={blocks}
      isExternal={isExternal}
Severity: Minor
Found in src/app/legacy/containers/InlineLink/index.stories.jsx and 1 other location - About 35 mins to fix
src/app/legacy/containers/RadioSchedule/Canonical/index.test.jsx on lines 23..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 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 2 locations. Consider refactoring.
Open

      it('should all be in the document', () => {
        expect(multipleFlourishVisualisations).toBeTruthy();
        expect(multipleFlourishVisualisations.length).toEqual(4);
      });
Severity: Minor
Found in src/integration/common/flourishEmbed.canonical.js and 1 other location - About 35 mins to fix
src/integration/common/flourishEmbed.amp.js on lines 8..11

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

  indexImage: {
    id: '98847234',
    subType: 'index',
    href: 'http://c.files.bbci.co.uk/A90A/production/_98847234_istanbul.eski.jpg',
    path: '/cpsprodpb/A90A/production/_98847234_istanbul.eski.jpg',
Severity: Minor
Found in src/app/lib/utilities/getStoryPromoInfo/index.test.jsx and 1 other location - About 35 mins to fix
src/app/lib/utilities/getStoryPromoInfo/index.test.jsx on lines 73..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 2 locations. Consider refactoring.
Open

                                    y = ((n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10)) + (n & o ^ n & i ^ o & i) | 0;
Severity: Minor
Found in public/vendor/cwr.js and 1 other location - About 35 mins to fix
public/vendor/cwr.js on lines 66..66

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

    it('for multiple items', () => {
      const { container } = renderContainer(
        ltrRecommendationsData,
        'mundo',
        toggleEnabled,
Severity: Minor
Found in src/app/legacy/containers/CpsRecommendations/index.test.jsx and 1 other location - About 35 mins to fix
src/app/legacy/containers/CpsRecommendations/index.test.jsx on lines 143..150

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

    it('for rtl service', () => {
      const { container } = renderContainer(
        rtlRecommendationsData,
        'arabic',
        toggleEnabled,
Severity: Minor
Found in src/app/legacy/containers/CpsRecommendations/index.test.jsx and 1 other location - About 35 mins to fix
src/app/legacy/containers/CpsRecommendations/index.test.jsx on lines 127..134

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

      <AmpImgPlaceholder
        media={`(min-width: ${GEL_GROUP_4_SCREEN_WIDTH_MIN})`}
        width="93px"
        height="27px"
        src={darkPlaceholder ? bgImageDark : bgImageRegular}
src/app/legacy/psammead/psammead-image-placeholder/src/index.amp.jsx on lines 50..55

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

  it('should not strip the domain if it is an external link', () => {
    const url = 'https://www.facebook.com/not-the-bbc';
    const relativeUrl = makeRelativeUrlPath(url);
    expect(relativeUrl).toBe(url);
  });
Severity: Minor
Found in src/app/lib/utilities/makeRelativeUrlPath/index.test.js and 1 other location - About 35 mins to fix
src/app/lib/analyticsUtils/index.test.js on lines 303..308

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

Avoid too many return statements within this function.
Open

      return [
        'modern.OnDemandAudioPage-31ecd969.ec6af2d0.js',
        'modern.commons-1111.js',
        'modern.commons-2222.js',
        'modern.1111-lib-1111.js',
Severity: Major
Found in scripts/bundleSize/__mocks__/pageTypeBundleExtractor.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return [
            'modern.ErrorPage-31ecd969.31473c35.js',
            'modern.commons-1111.js',
            'modern.commons-2222.js',
            'modern.1111-lib-1111.js',
    Severity: Major
    Found in scripts/bundleSize/__mocks__/pageTypeBundleExtractor.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return 0;
      Severity: Major
      Found in scripts/mostReadCollectionTimes.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return [
                'modern.MostReadPage-31ecd969.7484ff05.js',
                'modern.commons-1111.js',
                'modern.commons-2222.js',
                'modern.1111-lib-1111.js',
        Severity: Major
        Found in scripts/bundleSize/__mocks__/pageTypeBundleExtractor.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return [
                  'modern.OnDemandTvPage-31ecd969.de41ab7f.js',
                  'modern.commons-1111.js',
                  'modern.1111-lib-1111.js',
                  'modern.3333-lib-2222.js',
          Severity: Major
          Found in scripts/bundleSize/__mocks__/pageTypeBundleExtractor.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return [
                    'modern.FeatureIdxPage-31ecd969.31473c35.js',
                    'modern.commons-1111.js',
                    'modern.commons-2222.js',
                    'modern.1111-lib-1111.js',
            Severity: Major
            Found in scripts/bundleSize/__mocks__/pageTypeBundleExtractor.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return PROVIDERS.UNKNOWN;
              Severity: Major
              Found in src/app/legacy/containers/SocialEmbed/sourceHelpers.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return PROVIDERS.FACEBOOK;
                Severity: Major
                Found in src/app/legacy/containers/SocialEmbed/sourceHelpers.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return localToggles;
                  Severity: Major
                  Found in src/app/lib/utilities/getToggles/index.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return null;
                    Severity: Major
                    Found in src/app/components/Pagination/buildBlocks.ts - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language