Showing 2,206 of 2,206 total issues

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

  it(`should set isUK value to false when 'x-bbc-edge-isuk' is NOT 'yes'`, async () => {
    mockRouteProps({
      dataResponse: successDataResponse,
      isAmp: true,
    });
Severity: Major
Found in src/server/index.test.jsx and 1 other location - About 3 hrs to fix
src/server/index.test.jsx on lines 1528..1544

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

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 set isUK value to true when 'x-country' is set to 'gb' and 'x-bbc-edge-isuk' is not available`, async () => {
    mockRouteProps({
      dataResponse: successDataResponse,
      isAmp: true,
    });
Severity: Major
Found in src/server/index.test.jsx and 1 other location - About 3 hrs to fix
src/server/index.test.jsx on lines 1510..1526

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

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 empty text if the strapline is empty and is not the 1st section ', () => {
      const { container } = render(
        <Wrapper>
          <IndexPageSection group={hasNoStrapline} sectionNumber={1} />
        </Wrapper>,
Severity: Major
Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 1 other location - About 3 hrs to fix
src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 539..550

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

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 font-families.js has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 *  BBC REITH
 */
const reithFallback = `Helvetica, Arial, sans-serif;`;
const reithSans = `font-family: ReithSans, ${reithFallback}`;
Severity: Minor
Found in src/app/legacy/psammead/psammead-styles/src/font-families.js - About 3 hrs to fix

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

    import React from 'react';
    import {
      isNull,
      suppressPropWarnings,
    } from '#psammead/psammead-test-helpers/src';
    Severity: Minor
    Found in src/app/legacy/containers/ArticleTimestamp/index.test.jsx - About 3 hrs to fix

      Function L has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  L = function(e, t) {
                      var n,
                          r,
                          o,
                          i,
      Severity: Major
      Found in public/vendor/cwr.js - About 3 hrs to fix

        Function kn has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    kn = function(e, t) {
                        var n,
                            r,
                            o,
                            i,
        Severity: Major
        Found in public/vendor/cwr.js - About 3 hrs to fix

          Function s has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      s = function(e, t) {
                          var n,
                              r,
                              o,
                              i,
          Severity: Major
          Found in public/vendor/cwr.js - About 3 hrs to fix

            Function O has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        O = function(e, t) {
                            var n,
                                r,
                                o,
                                i,
            Severity: Major
            Found in public/vendor/cwr.js - About 3 hrs to fix

              Function e has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              function e() {
                                  var e = this;
                                  this.eventListener = function() {
                                      0 === performance.getEntriesByType(Ct).length ? e.performanceNavigationEventHandlerTimingLevel1() : new PerformanceObserver((function(t) {
                                          t.getEntries().forEach((function(t) {
              Severity: Major
              Found in public/vendor/cwr.js - About 3 hrs to fix

                Function lt has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            }, lt = function(e, t) {
                                var n,
                                    r,
                                    o,
                                    i,
                Severity: Major
                Found in public/vendor/cwr.js - About 3 hrs to fix

                  Function bt has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              }, bt = function(e, t) {
                                  var n,
                                      r,
                                      o,
                                      i,
                  Severity: Major
                  Found in public/vendor/cwr.js - About 3 hrs to fix

                    Function C has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                C = function(e, t) {
                                    var n,
                                        r,
                                        o,
                                        i,
                    Severity: Major
                    Found in public/vendor/cwr.js - About 3 hrs to fix

                      Function Se has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function Se(e, t) {
                                  var n,
                                      r,
                                      o,
                                      i,
                      Severity: Major
                      Found in public/vendor/cwr.js - About 3 hrs to fix

                        Function d has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        function d(e, t) {
                                            var n,
                                                r,
                                                o,
                                                i,
                        Severity: Major
                        Found in public/vendor/cwr.js - About 3 hrs to fix

                          Function jn has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      jn = function(e, t) {
                                          var n,
                                              r,
                                              o,
                                              i,
                          Severity: Major
                          Found in public/vendor/cwr.js - About 3 hrs to fix

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

                            import React from 'react';
                            import { render } from '../../../../components/react-testing-library-with-providers';
                            import Grid from '.';
                            import { ExampleParagraph, ExampleFigure, ExampleImage } from './testHelpers';
                            
                            
                            Severity: Minor
                            Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx - About 3 hrs to fix

                              File index.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { getEnvConfig } from '#app/lib/utilities/getEnvConfig';
                              import {
                                getDestination,
                                getAppType,
                                getScreenInfo,
                              Severity: Minor
                              Found in src/app/components/ATIAnalytics/atiUrl/index.ts - About 3 hrs to fix

                                Function Et has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            }, St = "CWR: Cannot dispatch; no AWS credentials.", Et = function() {
                                                function e(e, t, n, r) {
                                                    var o = this;
                                                    this.dispatchFetch = function() {
                                                        return wt(o, void 0, void 0, (function() {
                                Severity: Major
                                Found in public/vendor/cwr.js - About 3 hrs to fix

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

                                              <Grid
                                                item
                                                columns={{
                                                  group0: 6,
                                                  group1: 6,
                                  Severity: Major
                                  Found in src/app/legacy/psammead/psammead-grid/src/index.test.jsx and 3 other locations - About 3 hrs to fix
                                  src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 131..151
                                  src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 192..212
                                  src/app/legacy/psammead/psammead-grid/src/index.test.jsx on lines 215..235

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

                                  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