Showing 2,206 of 2,206 total issues

Avoid too many return statements within this function.
Open

    return <FlourishEmbed {...oembed} />;
Severity: Major
Found in src/app/components/Embeds/OEmbed/index.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return null;
    Severity: Major
    Found in src/app/components/Curation/index.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return <EmbedHtml embeddableContent={html} />;
      Severity: Major
      Found in src/app/components/Embeds/OEmbed/index.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return 'Unknown';
        Severity: Major
        Found in ws-nextjs-app/utilities/derivePageType/index.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return curationLength > 1 && (title || isFirstCuration) ? (
                    <section aria-labelledby={id} role="region">
                      {isFirstCuration ? (
                        <VisuallyHiddenText id={id} as="h2">
                          {curationSubheading}
          Severity: Major
          Found in src/app/components/Curation/index.tsx - About 30 mins to fix

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

                this.error = (event, message) => {
                  fileLogger.error({ file, event, message });
                };
            Severity: Major
            Found in src/app/lib/logger.node.js and 4 other locations - About 30 mins to fix
            src/app/lib/logger.node.js on lines 105..107
            src/app/lib/logger.node.js on lines 109..111
            src/app/lib/logger.node.js on lines 113..115
            src/app/lib/logger.node.js on lines 117..119

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

            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

                      {
                        items: [
                          {
                            headlines: {
                              headline: 'This is a headline',
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 8..24
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 67..83
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 98..114
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 139..155

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

            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

                      {
                        items: [
                          {
                            headlines: {
                              headline: 'This is a headline',
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 8..24
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 98..114
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 122..138
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 139..155

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

            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

                      {
                        items: [
                          {
                            headlines: {
                              headline: 'Good headline',
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 8..24
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 67..83
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 122..138
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 139..155

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

            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

                this.warn = (event, message) => {
                  fileLogger.warn({ file, event, message });
                };
            Severity: Major
            Found in src/app/lib/logger.node.js and 4 other locations - About 30 mins to fix
            src/app/lib/logger.node.js on lines 101..103
            src/app/lib/logger.node.js on lines 109..111
            src/app/lib/logger.node.js on lines 113..115
            src/app/lib/logger.node.js on lines 117..119

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

            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

                this.debug = (event, message) => {
                  fileLogger.debug({ file, event, message });
                };
            Severity: Major
            Found in src/app/lib/logger.node.js and 4 other locations - About 30 mins to fix
            src/app/lib/logger.node.js on lines 101..103
            src/app/lib/logger.node.js on lines 105..107
            src/app/lib/logger.node.js on lines 109..111
            src/app/lib/logger.node.js on lines 117..119

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

            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

                this.info = (event, message) => {
                  fileLogger.info({ file, event, message });
                };
            Severity: Major
            Found in src/app/lib/logger.node.js and 4 other locations - About 30 mins to fix
            src/app/lib/logger.node.js on lines 101..103
            src/app/lib/logger.node.js on lines 105..107
            src/app/lib/logger.node.js on lines 113..115
            src/app/lib/logger.node.js on lines 117..119

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

            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

                      {
                        items: [
                          {
                            headlines: {
                              headline: 'This is a headline',
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 67..83
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 98..114
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 122..138
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 139..155

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

            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

                      {
                        items: [
                          {
                            headlines: {
                              headline: 'Good headline',
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 8..24
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 67..83
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 98..114
            src/app/routes/utils/sharedDataTransformers/filterGroupsWithoutStraplines/index.test.js on lines 122..138

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

            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

                this.verbose = (event, message) => {
                  fileLogger.log({ file, event, message });
                };
            Severity: Major
            Found in src/app/lib/logger.node.js and 4 other locations - About 30 mins to fix
            src/app/lib/logger.node.js on lines 101..103
            src/app/lib/logger.node.js on lines 105..107
            src/app/lib/logger.node.js on lines 109..111
            src/app/lib/logger.node.js on lines 113..115

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

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

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

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

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

            Refactorings

            Further Reading

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

              it('should return true if cpsType is MAP', () => {
                const map = { cpsType: MEDIA_ASSET_PAGE };
                expect(isMap(map)).toBe(true);
              });
            Severity: Major
            Found in src/app/legacy/containers/StoryPromo/utilities/index.test.js and 3 other locations - About 30 mins to fix
            src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 25..28
            src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 37..40
            src/app/legacy/containers/StoryPromo/utilities/index.test.js on lines 42..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 45.

            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

                      {
                        type: 'secondary-top-story',
                        items: [{ name: 'item5' }, { name: 'item6' }, { name: 'item7' }],
                        strapline: {
                          name: 'Second availible strapline',
            src/app/routes/utils/sharedDataTransformers/squashTopStories/index.test.js on lines 12..18
            src/app/routes/utils/sharedDataTransformers/squashTopStories/index.test.js on lines 99..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 45.

            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

            describe('AMP', () => {
              describe(pageType, () => {
                runAmpTests(service);
                runInlineLinkTests();
                topicTags();
            Severity: Minor
            Found in src/integration/pages/articles/news/amp.test.js and 2 other locations - About 30 mins to fix
            src/integration/pages/articles/persian/amp.test.js on lines 10..16
            src/integration/pages/articles/persian/canonical.test.js on lines 10..16

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

            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

            describe('AMP', () => {
              describe(pageType, () => {
                runAmpTests(service);
                runImageCopyrightNonBBC();
                runParagraphTests();
            Severity: Minor
            Found in src/integration/pages/articles/persian/amp.test.js and 2 other locations - About 30 mins to fix
            src/integration/pages/articles/news/amp.test.js on lines 10..16
            src/integration/pages/articles/persian/canonical.test.js on lines 10..16

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

            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

            describe('Canonical', () => {
              describe(pageType, () => {
                runCanonicalTests(service);
                runImageCopyrightNonBBC();
                runParagraphTests();
            Severity: Minor
            Found in src/integration/pages/articles/persian/canonical.test.js and 2 other locations - About 30 mins to fix
            src/integration/pages/articles/news/amp.test.js on lines 10..16
            src/integration/pages/articles/persian/amp.test.js on lines 10..16

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

            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