Showing 2,206 of 2,206 total issues

Function pe has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            }, pe = function() {
                function e(e, t) {
                    var n = this;
                    this.events = [],
                    this.recordPageView = function(e) {
Severity: Major
Found in public/vendor/cwr.js - About 2 hrs to fix

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

    import shouldRender from '.';
    
    const validPortugueseData = {
      pageData: {
        metadata: {

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

          it('should return true when firstUpdated and lastUpdated are on different days', () => {
            const twoDaysAgo = timestampGenerator({ days: 2 });
            const oneDayAgo = timestampGenerator({ days: 1 });
            const shouldLastUpdatedTimestampBeDisplayed =
              shouldDisplayLastUpdatedTimestamp({
      src/app/legacy/containers/ArticleTimestamp/shouldDisplayLastUpdatedTimestamp.test.jsx on lines 89..100

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

      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 correctly render for expired episodes with audio skin', () => {
          const { getByText, container } = render(
            <ErrorMessageWithContext
              episodeAvailability={EPISODE_STATUS.EPISODE_IS_EXPIRED}
              skin="audio"
      src/app/lib/utilities/episodeAvailability/ErrorMessage/index.test.jsx on lines 15..28

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

      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 return true when article was firstPublished and lastUpdated yesterday, but the current time is within the lastPublished relative time period', () => {
            const twentyFourHoursAgo = timestampGenerator({ days: 1 });
            const nineHoursAgo = timestampGenerator({ hours: 9 });
            const shouldLastUpdatedTimestampBeDisplayed =
              shouldDisplayLastUpdatedTimestamp({
      src/app/legacy/containers/ArticleTimestamp/shouldDisplayLastUpdatedTimestamp.test.jsx on lines 115..126

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

      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 correctly render for future episodes with video skin', () => {
          const { getByText, container } = render(
            <ErrorMessageWithContext
              episodeAvailability={EPISODE_STATUS.EPISODE_IS_NOT_YET_AVAILABLE}
              skin="video"
      src/app/lib/utilities/episodeAvailability/ErrorMessage/index.test.jsx on lines 30..40

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

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

                  }(), de = function() {
                      function e(e, t) {
                          this.config = e,
                          this.record = t,
                          this.page = void 0,
      Severity: Major
      Found in public/vendor/cwr.js - About 2 hrs to fix

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

        import assocPath from 'ramda/src/assocPath';
        import * as fetchPageData from '../../utils/fetchPageData';
        import getInitialData from '.';
        import { TOPIC_PAGE } from '../../utils/pageTypes';
        
        
        Severity: Minor
        Found in src/app/routes/topic/getInitialData/index.test.js - About 2 hrs to fix

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

              it('should render null when there are no items', () => {
                const { container } = render(
                  <Wrapper>
                    <IndexPageSection group={hasNoItems} sectionNumber={0} />
                  </Wrapper>,
          Severity: Major
          Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 2 hrs to fix
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 504..514
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 516..526

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

          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 when there is no strapline but is the 1st section', () => {
                const { container } = render(
                  <Wrapper>
                    <IndexPageSection group={hasNoStrapline} sectionNumber={0} />
                  </Wrapper>,
          Severity: Major
          Found in src/app/legacy/containers/IndexPageSection/index.test.jsx and 2 other locations - About 2 hrs to fix
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 492..502
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 504..514

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

          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 null when there is no strapline 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 2 other locations - About 2 hrs to fix
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 492..502
          src/app/legacy/containers/IndexPageSection/index.test.jsx on lines 516..526

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

          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.each(supportedUzbekPageTypes)(
                    'should render script link when page type is %s',
                    pageType => {
                      const { container } = HeaderContainerWithContext({
                        renderOptions: {
          Severity: Major
          Found in src/app/legacy/containers/Header/index.test.jsx and 1 other location - About 2 hrs to fix
          src/app/legacy/containers/Header/index.test.jsx on lines 164..179

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

          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.each(unsupportedUzbekPageTypes)(
                    'should not render script link when page type is %s',
                    pageType => {
                      const { container } = HeaderContainerWithContext({
                        renderOptions: {
          Severity: Major
          Found in src/app/legacy/containers/Header/index.test.jsx and 1 other location - About 2 hrs to fix
          src/app/legacy/containers/Header/index.test.jsx on lines 147..162

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

          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 the Live TV offscreen text', () => {
                const { container } = render(
                  <BulletinContainer item={liveTvBulletinItem} />,
                  { service: 'igbo' },
                );
          Severity: Major
          Found in src/app/legacy/containers/Bulletin/index.test.jsx and 1 other location - About 2 hrs to fix
          src/app/legacy/containers/Bulletin/index.test.jsx on lines 65..74

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

          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

                                  })), (p = o, void 0 === p && (p = 0), new Promise((function(e, t) {
                                      p && setTimeout((function() {
                                          var e = new Error("Request did not complete within " + p + " ms");
                                          e.name = "TimeoutError",
                                          t(e)
          Severity: Major
          Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
          public/vendor/cwr.js on lines 1415..1421

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

          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 the Live Radio offscreen text', () => {
                const { container } = render(
                  <BulletinContainer item={liveRadioBulletinItem} />,
                  { service: 'igbo' },
                );
          Severity: Major
          Found in src/app/legacy/containers/Bulletin/index.test.jsx and 1 other location - About 2 hrs to fix
          src/app/legacy/containers/Bulletin/index.test.jsx on lines 55..63

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

          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

                                  })), (h = o, void 0 === h && (h = 0), new Promise((function(e, t) {
                                      h && setTimeout((function() {
                                          var e = new Error("Request did not complete within " + h + " ms");
                                          e.name = "TimeoutError",
                                          t(e)
          Severity: Major
          Found in public/vendor/cwr.js and 1 other location - About 2 hrs to fix
          public/vendor/cwr.js on lines 3547..3553

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

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

          const WithContexts = Component => {
            const WithContextsContainer = props => {
              const {
                toggles,
                bbcOrigin = null,
          Severity: Major
          Found in src/app/legacy/containers/PageHandlers/withContexts.jsx - About 2 hrs to fix

            Function NavigationContainer has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const NavigationContainer = () => {
              const { isAmp } = useContext(RequestContext);
            
              const { script, translations, navigation, service, dir } =
                useContext(ServiceContext);
            Severity: Major
            Found in src/app/legacy/containers/Navigation/index.jsx - About 2 hrs to fix

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

                              function e(e) {
                                  var t = this;
                                  this.ChainAnonymousCredentialsProvider = function() {
                                      return k(t, void 0, void 0, (function() {
                                          return L(this, (function(e) {
              Severity: Major
              Found in public/vendor/cwr.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language