Showing 2,206 of 2,206 total issues

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

    it('should contain an external link', () => {
      const { container } = render(<FooterContainer />);

      const paragraph = container.getElementsByTagName('p')[0];
      const externalLink = paragraph.getElementsByTagName('a')[0];
Severity: Major
Found in src/app/legacy/containers/Footer/index.test.jsx and 1 other location - About 2 hrs to fix
src/app/legacy/containers/Footer/index.test.jsx on lines 48..55

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 93.

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

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

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

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

Refactorings

Further Reading

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

    it('should contain a copyright symbol wrapped in span', () => {
      const { container } = render(<FooterContainer />);

      const paragraph = container.getElementsByTagName('p')[0];
      const copyrightSymbol = paragraph.getElementsByTagName('span')[0];
Severity: Major
Found in src/app/legacy/containers/Footer/index.test.jsx and 1 other location - About 2 hrs to fix
src/app/legacy/containers/Footer/index.test.jsx on lines 57..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 93.

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

export const GridItemLargeNoMargin = props => (
  <Grid
    {...props}
    item
    startOffset={{
Severity: Major
Found in src/app/legacy/components/Grid/index.jsx and 1 other location - About 2 hrs to fix
src/app/legacy/components/Grid/index.jsx on lines 126..147

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

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 withContexts.test.jsx has 287 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { render, act } from '@testing-library/react';
import { ComponentUsingContext } from '#testHelpers/mockComponents';
import getOriginContext from '#contexts/RequestContext/getOriginContext';
import getStatsDestination from '#contexts/RequestContext/getStatsDestination';
Severity: Minor
Found in src/app/legacy/containers/PageHandlers/withContexts.test.jsx - About 2 hrs to fix

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

    /* eslint-disable no-console */
    import React from 'react';
    import { render } from '../../../../components/react-testing-library-with-providers';
    import latin from '../../../../components/ThemeProvider/fontScripts/latin';
    import arabic from '../../../../components/ThemeProvider/fontScripts/arabic';
    Severity: Minor
    Found in src/app/legacy/psammead/psammead-section-label/src/index.test.jsx - About 2 hrs to fix

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

      import React from 'react';
      import * as PAGE_TYPES from '#app/routes/utils/pageTypes';
      import userEvent from '@testing-library/user-event';
      import Cookies from 'js-cookie';
      import {
      Severity: Minor
      Found in src/app/legacy/containers/Header/index.test.jsx - About 2 hrs to fix

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

        import React from 'react';
        import { MemoryRouter, Route } from 'react-router-dom';
        import { RequestContext, RequestContextProps } from '#contexts/RequestContext';
        import { ToggleContext } from '#contexts/ToggleContext';
        import {
        Severity: Minor
        Found in src/app/components/Header/ScriptLink/index.test.tsx - About 2 hrs to fix

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

          import React from 'react';
          import { BrowserRouter } from 'react-router-dom';
          import { Helmet } from 'react-helmet';
          import { data as kyrgyzHomePageData } from '#data/kyrgyz/homePage/index.json';
          import { data as afriqueHomePageDataFixture } from '#data/afrique/homePage/index.json';
          Severity: Minor
          Found in src/app/pages/HomePage/index.test.tsx - About 2 hrs to fix

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

                            return e.prototype.renewCredentials = function() {
                                if (!this.credentials || !this.credentials.expiration)
                                    return !0;
                                var e = new Date(this.credentials.expiration.getTime() - 3e4);
                                return new Date > e
            Severity: Major
            Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
            public/vendor/cwr.js on lines 1809..1814

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

            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

                            return e.prototype.renewCredentials = function() {
                                if (!this.credentials || !this.credentials.expiration)
                                    return !0;
                                var e = new Date(this.credentials.expiration.getTime() - 3e4);
                                return new Date > e
            Severity: Major
            Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
            public/vendor/cwr.js on lines 1999..2004

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

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

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

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

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

            Refactorings

            Further Reading

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

              it('should render with Media Indicator correctly', () => {
                const { container } = render(
                  <StoryPromo
                    image={Image}
                    info={Info({ promoType: 'top' })}
            src/app/legacy/psammead/psammead-story-promo/src/index.test.jsx on lines 171..181

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

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

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

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

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

            Refactorings

            Further Reading

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

                it('should be called with false when sectionNumber !== 0', () => {
                  render(
                    <Wrapper>
                      <IndexPageSection group={hasOneItem} sectionNumber={1} />
                    </Wrapper>,
            Severity: Major
            Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 2 hrs to fix
            src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 425..435

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

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

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

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

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

            Refactorings

            Further Reading

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

                it('should be called with true when sectionNumber === 0', () => {
                  render(
                    <Wrapper>
                      <IndexPageSection group={hasOneItem} sectionNumber={0} />
                    </Wrapper>,
            Severity: Major
            Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 2 hrs to fix
            src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 437..447

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

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

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

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

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

            Refactorings

            Further Reading

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

              it('should render with Media Indicator correctly', () => {
                const { container } = render(
                  <StoryPromo
                    image={Image}
                    info={Info({ promoType: 'leading' })}
            src/app/legacy/psammead/psammead-story-promo/src/index.test.jsx on lines 124..134

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 92.

            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 Hn has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        Hn = function() {
                            function e() {
                                var e = this;
                                this.commandHandlerMap = {
                                    setAwsCredentials: function(t) {
            Severity: Major
            Found in public/vendor/cwr.js - About 2 hrs to fix

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

                    <Grid
                      dir={dir}
                      columns={{
                        group0: 6,
                        group1: 6,
              Severity: Major
              Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx and 4 other locations - About 2 hrs to fix
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 543..664
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 671..896
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 903..1099
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1295..1441

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

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

                    <Grid
                      dir={dir}
                      columns={{
                        group0: 6,
                        group1: 6,
              Severity: Major
              Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx and 4 other locations - About 2 hrs to fix
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 251..536
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 671..896
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 903..1099
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1295..1441

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

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

                    <Grid
                      dir={dir}
                      columns={{
                        group0: 6,
                        group1: 6,
              Severity: Major
              Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx and 4 other locations - About 2 hrs to fix
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 251..536
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 543..664
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 671..896
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1295..1441

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

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

                      <Grid
                        dir={dir}
                        columns={{
                          group0: 6,
                          group1: 6,
              Severity: Major
              Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx and 4 other locations - About 2 hrs to fix
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 251..536
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 543..664
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 671..896
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 903..1099

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

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

                    <Grid
                      dir={dir}
                      columns={{
                        group0: 6,
                        group1: 6,
              Severity: Major
              Found in src/app/legacy/psammead/psammead-grid/src/index.stories.jsx and 4 other locations - About 2 hrs to fix
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 251..536
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 543..664
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 903..1099
              src/app/legacy/psammead/psammead-grid/src/index.stories.jsx on lines 1295..1441

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

              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