Showing 2,206 of 2,206 total issues

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

  it('should render podcast in a strong element', () => {
    const { getByText } = render(<PromoWithContext inline />);

    expect(getByText(brandTitle).closest('strong')).toBeInTheDocument();
  });
Severity: Major
Found in src/app/legacy/containers/PodcastPromo/index.test.jsx and 2 other locations - About 1 hr to fix
src/app/legacy/containers/PodcastPromo/index.test.jsx on lines 103..107
src/app/legacy/containers/PodcastPromo/index.test.jsx on lines 109..113

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

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

Function getAuthorTwitterHandle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getAuthorTwitterHandle = articleContentBlocks => {
  const [firstByline, ...otherBylines] = articleContentBlocks.filter(
    block => block.type === 'byline',
  );

Severity: Minor
Found in src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js - About 1 hr to fix

    Function handleFileChange has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const handleFileChange = (event: ChangeEvent<HTMLInputElement>) => {
        // Converts FileList to an actual array
        const chosenFiles = Array.prototype.slice.call(
          event.target.files,
        ) as File[];
    Severity: Minor
    Found in ws-nextjs-app/pages/[service]/send/[id]/FormField/File/index.tsx - About 1 hr to fix

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

          it('should render a Live TV bulletin correctly', () => {
            const { container } = render(
              <BulletinContainer item={liveTvBulletinItem} />,
              { service: 'igbo' },
            );
      Severity: Major
      Found in src/app/legacy/containers/Bulletin/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 13..19
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 21..27
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 37..43
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 45..51

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

      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 correctly render for 404', () => {
          const { container } = render(<ErrorPage errorCode={404} />, {
            service: 'news',
          });
          expect(container).toMatchSnapshot();
      Severity: Major
      Found in src/app/pages/ErrorPage/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/pages/ErrorPage/index.test.jsx on lines 13..18
      src/app/pages/ErrorPage/index.test.jsx on lines 20..25
      src/app/pages/ErrorPage/index.test.jsx on lines 27..32
      src/app/pages/ErrorPage/index.test.jsx on lines 34..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 64.

      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

          act(() => {
            triggerIntersection({
              changes: [{ isIntersecting: true }],
              observer: observerInstanceA,
            });
      Severity: Major
      Found in src/app/hooks/useViewTracker/index.test.jsx and 1 other location - About 1 hr to fix
      src/app/hooks/useViewTracker/index.test.jsx on lines 339..348

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

      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 fetch with the correct url when passed the pathname', async () => {
            await fetchPageData({ path: requestedPathname, pageType });
      
            expect(timeoutSpy).toHaveBeenCalledTimes(1);
            expect(fetch).toHaveBeenCalledWith(expectedUrl, fetchOptions);
      Severity: Major
      Found in src/app/routes/utils/fetchPageData/index.test.js and 3 other locations - About 1 hr to fix
      src/app/routes/utils/fetchPageData/index.test.js on lines 100..105
      src/app/routes/utils/fetchPageData/index.test.js on lines 107..112
      src/app/routes/utils/fetchPageData/index.test.js on lines 114..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 64.

      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 fetch on amp pages without .amp in pathname', async () => {
            await fetchPageData({ path: requestedPathname, pageType });
      
            expect(timeoutSpy).toHaveBeenCalledTimes(1);
            expect(fetch).toHaveBeenCalledWith(expectedUrl, fetchOptions);
      Severity: Major
      Found in src/app/routes/utils/fetchPageData/index.test.js and 3 other locations - About 1 hr to fix
      src/app/routes/utils/fetchPageData/index.test.js on lines 93..98
      src/app/routes/utils/fetchPageData/index.test.js on lines 100..105
      src/app/routes/utils/fetchPageData/index.test.js on lines 107..112

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

      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 render a TV bulletin with lang attribute', () => {
            const { container } = render(
              <BulletinContainer item={tvBulletinItem} />,
              { service: 'scotland' },
            );
      Severity: Major
      Found in src/app/legacy/containers/Bulletin/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 13..19
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 29..35
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 37..43
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 45..51

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

      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 render a Live Radio bulletin correctly', () => {
            const { container } = render(
              <BulletinContainer item={liveRadioBulletinItem} />,
              { service: 'igbo' },
            );
      Severity: Major
      Found in src/app/legacy/containers/Bulletin/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 13..19
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 21..27
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 29..35
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 37..43

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

      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 correctly render for 404 for persian', () => {
          const { container } = render(<ErrorPage errorCode={404} />, {
            service: 'persian',
          });
          expect(container).toMatchSnapshot();
      Severity: Major
      Found in src/app/pages/ErrorPage/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/pages/ErrorPage/index.test.jsx on lines 6..11
      src/app/pages/ErrorPage/index.test.jsx on lines 13..18
      src/app/pages/ErrorPage/index.test.jsx on lines 20..25
      src/app/pages/ErrorPage/index.test.jsx on lines 34..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 64.

      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 render a Radio bulletin correctly', () => {
            const { container } = render(
              <BulletinContainer item={radioBulletinItem} />,
              { service: 'igbo' },
            );
      Severity: Major
      Found in src/app/legacy/containers/Bulletin/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 13..19
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 21..27
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 29..35
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 45..51

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

      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 correctly render for other status code', () => {
          const { container } = render(<ErrorPage errorCode={123} />, {
            service: 'news',
          });
          expect(container).toMatchSnapshot();
      Severity: Major
      Found in src/app/pages/ErrorPage/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/pages/ErrorPage/index.test.jsx on lines 6..11
      src/app/pages/ErrorPage/index.test.jsx on lines 13..18
      src/app/pages/ErrorPage/index.test.jsx on lines 27..32
      src/app/pages/ErrorPage/index.test.jsx on lines 34..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 64.

      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 fetch with the correct url when passed the full test path', async () => {
            await fetchPageData({ path: fullTestPath, pageType });
      
            expect(timeoutSpy).toHaveBeenCalledTimes(1);
            expect(fetch).toHaveBeenCalledWith(fullTestPath, fetchOptions);
      Severity: Major
      Found in src/app/routes/utils/fetchPageData/index.test.js and 3 other locations - About 1 hr to fix
      src/app/routes/utils/fetchPageData/index.test.js on lines 93..98
      src/app/routes/utils/fetchPageData/index.test.js on lines 107..112
      src/app/routes/utils/fetchPageData/index.test.js on lines 114..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 64.

      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 render a TV bulletin correctly', () => {
            const { container } = render(
              <BulletinContainer item={tvBulletinItem} />,
              { service: 'igbo' },
            );
      Severity: Major
      Found in src/app/legacy/containers/Bulletin/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 21..27
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 29..35
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 37..43
      src/app/legacy/containers/Bulletin/index.test.jsx on lines 45..51

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

      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 fetch with the correct url when passed the full live path', async () => {
            await fetchPageData({ path: fullLivePath, pageType });
      
            expect(timeoutSpy).toHaveBeenCalledTimes(1);
            expect(fetch).toHaveBeenCalledWith(fullLivePath, fetchOptions);
      Severity: Major
      Found in src/app/routes/utils/fetchPageData/index.test.js and 3 other locations - About 1 hr to fix
      src/app/routes/utils/fetchPageData/index.test.js on lines 93..98
      src/app/routes/utils/fetchPageData/index.test.js on lines 100..105
      src/app/routes/utils/fetchPageData/index.test.js on lines 114..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 64.

      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

          act(() => {
            triggerIntersection({
              changes: [{ isIntersecting: true }],
              observer: observerInstanceA,
            });
      Severity: Major
      Found in src/app/hooks/useViewTracker/index.test.jsx and 1 other location - About 1 hr to fix
      src/app/hooks/useViewTracker/index.test.jsx on lines 270..279

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

      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 correctly render for 500', () => {
          const { container } = render(<ErrorPage errorCode={500} />, {
            service: 'news',
          });
          expect(container).toMatchSnapshot();
      Severity: Major
      Found in src/app/pages/ErrorPage/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/pages/ErrorPage/index.test.jsx on lines 6..11
      src/app/pages/ErrorPage/index.test.jsx on lines 20..25
      src/app/pages/ErrorPage/index.test.jsx on lines 27..32
      src/app/pages/ErrorPage/index.test.jsx on lines 34..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 64.

      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 correctly render for 500 for persian', async () => {
          const { container } = render(<ErrorPage errorCode={500} />, {
            service: 'persian',
          });
          expect(container).toMatchSnapshot();
      Severity: Major
      Found in src/app/pages/ErrorPage/index.test.jsx and 4 other locations - About 1 hr to fix
      src/app/pages/ErrorPage/index.test.jsx on lines 6..11
      src/app/pages/ErrorPage/index.test.jsx on lines 13..18
      src/app/pages/ErrorPage/index.test.jsx on lines 20..25
      src/app/pages/ErrorPage/index.test.jsx on lines 27..32

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

      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

              expect(winston.transports.File).toHaveBeenCalledWith({
                filename: 'log/app.log',
                handleExceptions: true,
                humanReadableUnhandledException: true,
                format: 'Combine Mock',
      Severity: Major
      Found in src/app/lib/logger.node.test.js and 1 other location - About 1 hr to fix
      src/app/lib/logger.node.test.js on lines 84..93

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

      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