Showing 2,206 of 2,206 total issues

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

      expect(methodCall).toStrictEqual({
        assetUri: undefined,
        errorCode: undefined,
        id: undefined,
        isAmp: true,
src/app/routes/utils/fetchPageData/utils/getRouteProps/index.test.js on lines 289..300

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

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 extract and render the correct href', () => {
    const { queryByRole } = render(
      <ScrollablePromo block={PromoSingleBlock} />,
    );
    expect(queryByRole('link').href).toEqual('https://www.bbc.com/mundo');
src/app/legacy/containers/Headings/index.test.jsx on lines 235..240

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

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

            x = function(e) {
                var t = this;
                this.assumeRoleWithWebIdentity = function(e) {
                    return E(t, void 0, void 0, (function() {
                        var t,
Severity: Minor
Found in public/vendor/cwr.js - About 1 hr to fix

    Function performanceNavigationEventHandlerTimingLevel2 has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        this.performanceNavigationEventHandlerTimingLevel2 = function(t) {
                            var n = {
                                version: "1.0.0",
                                initiatorType: t.initiatorType,
                                navigationType: t.type,
    Severity: Minor
    Found in public/vendor/cwr.js - About 1 hr to fix

      Function Z has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  Z = function() {
                      function e(e) {
                          var t = this;
                          this.eventHandler = function(e) {
                              t.recordEvent(q, V(e, t.config.stackTraceLength))
      Severity: Minor
      Found in public/vendor/cwr.js - About 1 hr to fix

        Function getPalette has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          (o.prototype.getPalette = function (t, o, e) {
            var i = (function (t) {
                var r = t.colorCount,
                  n = t.quality;
                if (void 0 !== r && Number.isInteger(r)) {
        Severity: Minor
        Found in src/app/hooks/useImageColour/colorthief.js - About 1 hr to fix

          Function withOptimizelyProvider has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const withOptimizelyProvider = Component => {
            return props => {
              const { service } = useContext(ServiceContext);
              const isStoryBook = process.env.STORYBOOK;
              const disableOptimizely = isStoryBook;

            Function Img has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Img = props => {
              const {
                src,
                srcset = null,
                sizes = null,
            Severity: Minor
            Found in src/app/legacy/psammead/psammead-image/src/index.jsx - About 1 hr to fix

              Function buildImageProperties has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const buildImageProperties = (imageProps?: ImageProps) => {
                const image =
                  imageProps?.path || imageProps?.locator ? imageProps : defaultImageProps;
              
                const {
              Severity: Minor
              Found in src/app/components/FrostedGlassPromo/withData.tsx - About 1 hr to fix

                Function getServerSideProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getServerSideProps: GetServerSideProps = async context => {
                  logResponseTime(
                    {
                      path: context.resolvedUrl,
                    },
                Severity: Minor
                Found in ws-nextjs-app/pages/[service]/downloads/[[...variant]].page.tsx - About 1 hr to fix

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

                  const PODCAST_FIXTURE = {
                    title: 'Подкаст',
                    brandTitle: 'Что это было?',
                    brandDescription: 'Мы быстро, просто и понятно объясняем',
                    image: {
                  Severity: Major
                  Found in src/app/legacy/containers/PodcastPromo/shared.test.js and 1 other location - About 1 hr to fix
                  src/app/legacy/containers/PodcastPromo/index.stories.jsx on lines 13..30

                  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

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

                  moment.updateLocale('uk', {
                    longDateFormat: {
                      LL: 'D MMMM YYYY',
                      LLL: 'D MMMM YYYY, HH:mm',
                      LLLL: 'dddd, D MMMM YYYY, HH:mm',
                  Severity: Major
                  Found in src/app/legacy/psammead/psammead-locales/moment/uk.js and 1 other location - About 1 hr to fix
                  src/app/legacy/psammead/psammead-locales/moment/es.js on lines 4..17

                  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

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

                  moment.updateLocale('es', {
                    longDateFormat: {
                      LL: 'D MMMM YYYY',
                      LLL: 'D MMMM YYYY H:mm',
                      LLLL: 'dddd, D MMMM YYYY H:mm',
                  Severity: Major
                  Found in src/app/legacy/psammead/psammead-locales/moment/es.js and 1 other location - About 1 hr to fix
                  src/app/legacy/psammead/psammead-locales/moment/uk.js on lines 4..17

                  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

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

                    describe('Africa Eye TV', () => {
                      it('should construct correct data file path', () => {
                        expect(
                          constructDataFilePath({
                            pageType: 'africa_eye',
                  Severity: Major
                  Found in src/server/local/constructDataFilePath/index.test.js and 1 other location - About 1 hr to fix
                  src/server/local/constructDataFilePath/index.test.js on lines 26..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 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

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

                    describe('Home Page', () => {
                      it('should construct correct data file path', () => {
                        expect(
                          constructDataFilePath({ pageType: 'homePage', service: 'kyrgyz' }),
                        ).toEqual(`${DATA_PATH}/data/kyrgyz/homePage/index.json`);
                  Severity: Major
                  Found in src/server/local/constructDataFilePath/index.test.js and 1 other location - About 1 hr to fix
                  src/server/local/constructDataFilePath/index.test.js on lines 159..168

                  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

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

                    it('should render the description in a paragraph element', () => {
                      const { getByText } = render(<PromoWithContext inline />);
                  
                      expect(getByText(brandDescription).closest('p')).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 72..76
                  src/app/legacy/containers/PodcastPromo/index.test.jsx on lines 103..107

                  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

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

                          dependencyTable = dependencyTable.sort((a, b) => {
                            if (a.name < b.name) {
                              return -1;
                            }
                            if (a.name > b.name) {
                  Severity: Major
                  Found in scripts/dependencyFreshness.js and 1 other location - About 1 hr to fix
                  scripts/esmDependencyCheck.js on lines 123..132

                  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

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

                    it('should render the title text in a <a> element', () => {
                      const { getByText } = render(<PromoWithContext inline />);
                  
                      expect(getByText(brandTitle).closest('a')).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 72..76
                  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

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

                    data
                      .sort((a, b) => {
                        if (a.name < b.name) {
                          return -1;
                        }
                  Severity: Major
                  Found in scripts/esmDependencyCheck.js and 1 other location - About 1 hr to fix
                  scripts/dependencyFreshness.js on lines 65..73

                  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

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

                    podcastPromo: {
                      title: 'Podcast',
                      brandTitle: 'Sounds of the 90s with Fearne Cotton',
                      brandDescription:
                        'Join Fearne for a nostalgia drenched celebration of the best music and pop culture from the 90s.',
                  Severity: Major
                  Found in src/app/legacy/containers/PodcastPromo/index.stories.jsx and 1 other location - About 1 hr to fix
                  src/app/legacy/containers/PodcastPromo/shared.test.js on lines 3..19

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language