Showing 2,206 of 2,206 total issues

Function Promo has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Promo = () => {
  const { podcastPromo, script, service, dir } = useContext(ServiceContext);
  const { pageType, isLite } = useContext(RequestContext);

  const {
Severity: Major
Found in src/app/legacy/containers/PodcastPromo/Inline.jsx - About 3 hrs to fix

    File index.test.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import loggerMock from '#testHelpers/loggerMock'; // Must be imported before fetchPageData
    import {
      DATA_FETCH_ERROR,
      DATA_REQUEST_RECEIVED,
      DATA_RESPONSE_FROM_CACHE,
    Severity: Minor
    Found in src/app/routes/utils/fetchPageData/index.test.js - About 3 hrs to fix

      Function FormContextProvider has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      export const FormContextProvider = ({
        initialScreen = 'form',
        fields,
        children,
      }: PropsWithChildren<{ initialScreen?: FormScreen; fields: Field[] }>) => {
      Severity: Minor
      Found in ws-nextjs-app/pages/[service]/send/[id]/FormContext/index.tsx - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      const SMALL = [
        [VerticalPromo],
        [VerticalPromo, VerticalPromo],
        [BigPromo, HorizontalPromo, HorizontalPromo],
        [BigPromo, HorizontalPromo, HorizontalPromo, HorizontalPromo],
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 10..93
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 95..178
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 180..263

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

      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 () => {
        describe('Expired Episode', () => {
          runCommonEpisodeTests();
      
          it(`I can see the 'Content is not available' placeholder`, () => {
      src/integration/pages/onDemandTVPage/expiredEpisodeTests.js on lines 3..15

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

      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 () => {
        describe('Expired Episode', () => {
          runCommonEpisodeTests();
      
          it(`I can see the 'Content is not available' placeholder`, () => {
      Severity: Major
      Found in src/integration/pages/onDemandTVPage/expiredEpisodeTests.js and 1 other location - About 3 hrs to fix
      src/integration/pages/onDemandAudioPage/expiredEpisodeTests.js on lines 3..15

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

      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

      const MOBILE = [
        [VerticalPromo],
        [VerticalPromo, VerticalPromo],
        [BigPromo, VerticalPromo, VerticalPromo],
        [BigPromo, VerticalPromo, VerticalPromo, HorizontalPromo],
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 10..93
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 95..178
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 265..354

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

      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

      const DESKTOP = [
        [VerticalPromo],
        [VerticalPromo, VerticalPromo],
        [DesktopBigPromo, TallPromo, TallPromo],
        [DesktopBigPromo, VerticalPromo, VerticalPromo, VerticalPromo],
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 95..178
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 180..263
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 265..354

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

      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

      const TABLET = [
        [VerticalPromo],
        [VerticalPromo, VerticalPromo],
        [DesktopBigPromo, VerticalPromo, VerticalPromo],
        [DesktopBigPromo, VerticalPromo, CompactPromo, CompactPromo],
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 10..93
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 180..263
      src/app/components/Curation/HierarchicalGrid/dataStructures.js on lines 265..354

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

      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 not render the story promo inside a list when only one item exists', () => {
            const { container } = render(
              <Wrapper>
                <IndexPageSection group={hasOneItem} sectionNumber={0} />
              </Wrapper>,
      Severity: Major
      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 580..589
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 601..613

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

      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

        serviceThemeBundleData.forEach(
          ({ serviceName, bundles, totalSizeInBytes, totalSize }) => {
            const getFileInfo = ({ name, size }) =>
              `${removeBundleTypePrefix(name)} (${size}kB)`;
      
      
      Severity: Major
      Found in scripts/bundleSize/index.js and 1 other location - About 3 hrs to fix
      scripts/bundleSize/index.js on lines 118..130

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

      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 remove query string from ID', async () => {
          fetch.mockResponse(JSON.stringify(topicJSON));
          const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
          await getInitialData({
            path: 'pidgin/topics/c0000000000t?foo=bar',
      Severity: Major
      Found in src/app/routes/topic/getInitialData/index.test.js and 3 other locations - About 3 hrs to fix
      src/app/routes/topic/getInitialData/index.test.js on lines 129..144
      src/app/routes/topic/getInitialData/index.test.js on lines 164..179
      src/app/routes/topic/getInitialData/index.test.js on lines 198..213

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

      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 remove .amp from ID', async () => {
          fetch.mockResponse(JSON.stringify(topicJSON));
          const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
          await getInitialData({
            path: 'pidgin/topics/c0000000000t.amp',
      Severity: Major
      Found in src/app/routes/topic/getInitialData/index.test.js and 3 other locations - About 3 hrs to fix
      src/app/routes/topic/getInitialData/index.test.js on lines 129..144
      src/app/routes/topic/getInitialData/index.test.js on lines 181..196
      src/app/routes/topic/getInitialData/index.test.js on lines 198..213

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

      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 remove .amp and query string from ID', async () => {
          fetch.mockResponse(JSON.stringify(topicJSON));
          const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
          await getInitialData({
            path: 'pidgin/topics/c0000000000t.amp?foo=bar',
      Severity: Major
      Found in src/app/routes/topic/getInitialData/index.test.js and 3 other locations - About 3 hrs to fix
      src/app/routes/topic/getInitialData/index.test.js on lines 129..144
      src/app/routes/topic/getInitialData/index.test.js on lines 164..179
      src/app/routes/topic/getInitialData/index.test.js on lines 181..196

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

      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 render everything after the first non-radio bulletin', () => {
            const { container } = render(
              <Wrapper>
                <IndexPageSection
                  group={startsWithRadioBulletins}
      Severity: Major
      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 528..537
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 580..589

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

      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

        serviceConfigBundleData.forEach(
          ({ serviceName, bundles, totalSizeInBytes, totalSize }) => {
            const getFileInfo = ({ name, size }) =>
              `${removeBundleTypePrefix(name)} (${size}kB)`;
      
      
      Severity: Major
      Found in scripts/bundleSize/index.js and 1 other location - About 3 hrs to fix
      scripts/bundleSize/index.js on lines 132..144

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

      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 call fetchPageData with the correct request URL', async () => {
          fetch.mockResponse(JSON.stringify(topicJSON));
          const fetchDataSpy = jest.spyOn(fetchPageData, 'default');
          await getInitialData({
            path: 'pidgin/topics/c0000000000t',
      Severity: Major
      Found in src/app/routes/topic/getInitialData/index.test.js and 3 other locations - About 3 hrs to fix
      src/app/routes/topic/getInitialData/index.test.js on lines 164..179
      src/app/routes/topic/getInitialData/index.test.js on lines 181..196
      src/app/routes/topic/getInitialData/index.test.js on lines 198..213

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

      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 render useful links when the semantic group name is "Useful links"', () => {
            const { container } = render(
              <Wrapper>
                <IndexPageSection group={usefulLinks} sectionNumber={1} />
              </Wrapper>,
      Severity: Major
      Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 3 hrs to fix
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 528..537
      src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 601..613

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

      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 cookie.amp.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import { Helmet } from 'react-helmet';
      import styled from '@emotion/styled';
      import {
        getDoublePica,
      Severity: Minor
      Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx - About 3 hrs to fix

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

          it('should fire event when scroll depth reaches 100% threshold and lower thresholds', () => {
            const { result } = renderHook(() => useOptimizelyScrollDepth(), {
              wrapper,
            });
        
        
        Severity: Major
        Found in src/app/hooks/useOptimizelyScrollDepth/index.test.jsx and 3 other locations - About 3 hrs to fix
        src/app/hooks/useOptimizelyScrollDepth/index.test.jsx on lines 105..116
        src/app/hooks/useOptimizelyScrollDepth/index.test.jsx on lines 132..143
        src/app/hooks/useOptimizelyScrollDepth/index.test.jsx on lines 159..170

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

        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