Showing 2,206 of 2,206 total issues

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

moment.defineLocale('ti', {
  months: 'ጥሪ_ለካቲት_መጋቢት_ሚያዝያ_ጉንቦት_ሰነ_ሓምለ_ነሓሰ_መስከረም_ጥቅምቲ_ሕዳር_ታሕሳስ'.split('_'),
  longDateFormat: { LL: 'D MMMM YYYY' },
  relativeTime: {
    past: 'ቅድሚ %s',
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/ti.js and 4 other locations - About 1 hr to fix
src/app/legacy/psammead/psammead-locales/moment/am.js on lines 3..13
src/app/legacy/psammead/psammead-locales/moment/ha.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/rw.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/so.js on lines 3..16

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

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

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

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

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

Refactorings

Further Reading

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

moment.defineLocale('am', {
  months: 'ጥር_የካቲት_መጋቢት_ሚያዚያ_ግንቦት_ሰኔ_ሀምሌ_ነሐሴ_መስከረም_ጥቅምት_ህዳር_ታህሳስ'.split('_'),
  longDateFormat: { LL: 'D MMMM YYYY' },
  relativeTime: {
    past: '%s በፊት',
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/am.js and 4 other locations - About 1 hr to fix
src/app/legacy/psammead/psammead-locales/moment/ha.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/rw.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/so.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/ti.js on lines 3..13

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

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

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

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

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

Refactorings

Further Reading

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

moment.defineLocale('so', {
  months:
    'Jannaayo_Febraayo_Maarso_Abriil_Maajo_Juunyo_Luulyo_Agoosto_Sebtembar_Oktoobar_Nofembar_Disembar'.split(
      '_'
    ),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/so.js and 4 other locations - About 1 hr to fix
src/app/legacy/psammead/psammead-locales/moment/am.js on lines 3..13
src/app/legacy/psammead/psammead-locales/moment/ha.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/rw.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/ti.js on lines 3..13

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

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

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

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

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

Refactorings

Further Reading

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

moment.defineLocale('rw', {
  months:
    "Ukwa mbere_Ukwa kabiri_Ukwa gatatu_Ukwa kane_Ukwa gatanu_Ukwa gatandatu_Ukw'indwi_Ukw'umunani_Ukw'icenda_Ukw'icumi_Ukw'icumi na rimwe_Ukw'icumi na kabiri".split(
      '_'
    ),
Severity: Major
Found in src/app/legacy/psammead/psammead-locales/moment/rw.js and 4 other locations - About 1 hr to fix
src/app/legacy/psammead/psammead-locales/moment/am.js on lines 3..13
src/app/legacy/psammead/psammead-locales/moment/ha.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/so.js on lines 3..16
src/app/legacy/psammead/psammead-locales/moment/ti.js on lines 3..13

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

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 APP version correctly', () => {
    const dom = new JSDOM(
      renderToString(<TestDocumentComponent service="news" isApp />),
    );
    expect(dom.window.document.documentElement).toMatchSnapshot();
Severity: Major
Found in src/server/Document/component.test.jsx and 2 other locations - About 1 hr to fix
src/server/Document/component.test.jsx on lines 78..83
src/server/Document/component.test.jsx on lines 103..108

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

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

const usefulCaptions = [
  {
    name: 'Mitocinmu da sauko da sautin labarai',
    url: 'https://www.bbc.com/igbo/afirika-49883577',
  },
src/app/legacy/psammead/psammead-useful-links/src/index.stories.jsx on lines 8..29

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

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

const TextGridFallBackLeadingStory = dir => `
  width: ${fullWidthColumnsMaxScaleable};
  @media (min-width: ${GEL_GROUP_3_SCREEN_WIDTH_MIN}) {
    ${
      dir === 'rtl'
src/app/legacy/psammead/psammead-story-promo/src/ImageStyles.jsx on lines 76..91

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

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

const ImageGridFallbackLeadingStory = dir => `
  width: ${fullWidthColumnsMaxScaleable};

  @media (min-width: ${GEL_GROUP_3_SCREEN_WIDTH_MIN}) {
    ${
src/app/legacy/psammead/psammead-story-promo/src/TextStyles.jsx on lines 96..109

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

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

const usefulCaptions = [
  {
    name: 'Mobile loophole for gaming drivers is closed',
    url: 'https://www.bbc.com/igbo/afirika-49883577',
  },
src/app/legacy/psammead/psammead-useful-links/src/index.test.jsx on lines 6..27

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

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 LITE version correctly', () => {
    const dom = new JSDOM(
      renderToString(<TestDocumentComponent service="news" isLite />),
    );
    expect(dom.window.document.documentElement).toMatchSnapshot();
Severity: Major
Found in src/server/Document/component.test.jsx and 2 other locations - About 1 hr to fix
src/server/Document/component.test.jsx on lines 78..83
src/server/Document/component.test.jsx on lines 96..101

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

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 add override query on test', () => {
    process.env.SIMORGH_APP_ENV = 'test';
    const url = 'path-name';
    const expected = 'path-name?renderer_env=live';

Severity: Major
Found in src/app/routes/utils/overrideRendererOnTest/index.test.js and 1 other location - About 1 hr to fix
src/app/routes/utils/overrideRendererOnTest/index.test.js on lines 69..76

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

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 AMP version correctly', () => {
    const dom = new JSDOM(
      renderToString(<TestDocumentComponent service="news" isAmp />),
    );
    expect(dom.window.document.documentElement).toMatchSnapshot();
Severity: Major
Found in src/server/Document/component.test.jsx and 2 other locations - About 1 hr to fix
src/server/Document/component.test.jsx on lines 96..101
src/server/Document/component.test.jsx on lines 103..108

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

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 not add override query on live', () => {
    process.env.SIMORGH_APP_ENV = 'live';
    const url = 'path-name';
    const expected = 'path-name';

Severity: Major
Found in src/app/routes/utils/overrideRendererOnTest/index.test.js and 1 other location - About 1 hr to fix
src/app/routes/utils/overrideRendererOnTest/index.test.js on lines 60..67

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

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

export const bylineBlock = (text, id = null) => {
  const fragment = singleFragmentBlock(`@${text}`, id);
  const urlLink = optionalIdBlock(
    blockBase('urlLink', {
      text: `@${text}`,
Severity: Minor
Found in src/app/models/blocks/index.js - About 1 hr to fix

    Function Ln has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                Ln = function(e) {
                    return Pn(void 0, void 0, void 0, (function() {
                        var t,
                            n;
                        return kn(this, (function(r) {
    Severity: Minor
    Found in public/vendor/cwr.js - About 1 hr to fix

      Function exports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = api => {
        const env = api.env();
        const useModern = env === 'modern';
      
        const presets = [
      Severity: Minor
      Found in babel.config.main.js - About 1 hr to fix

        Function test has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                it('should be displayed if there is enough schedule data', function test() {
                  const currentPath = `${Cypress.env(
                    'currentPath',
                  )}.json${overrideRendererOnTest()}`;
        
        
        Severity: Minor
        Found in cypress/e2e/pages/onDemandAudio/tests.js - About 1 hr to fix

          Function childrenFallback has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const childrenFallback = (
            item,
            dir,
            columnsGroup,
            marginsGroup,
          Severity: Minor
          Found in src/app/legacy/psammead/psammead-grid/src/index.jsx - About 1 hr to fix

            Function liveBlogUpdate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                .map(result => {
                  const headerBlocks = result?.header?.model?.blocks;
                  const contentBlocks = result?.content?.model?.blocks;
            
                  if (!headerBlocks || !contentBlocks) return null;
            Severity: Minor
            Found in src/app/lib/seoUtils/getLiveBlogPostingSchema/index.ts - About 1 hr to fix

              Function Ve has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          Ve = function(e, t) {
                              var n = e.headers,
                                  r = e.body;
                              return be(void 0, void 0, void 0, (function() {
                                  var e,
              Severity: Minor
              Found in public/vendor/cwr.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language