Showing 2,206 of 2,206 total issues

Function bn has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            bn = function(e) {
                function t(t) {
                    var n = e.call(this) || this;
                    return n.addXRayTraceIdHeader = function() {
                        return n.config.addXRayTraceIdHeader
Severity: Major
Found in public/vendor/cwr.js - About 5 hrs to fix

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

    test('lenient day of month ordinal parsing of number', () => {
      let i;
      let testMoment;
      for (i = 1; i <= 31; i += 1) {
        testMoment = moment(`2014 01 ${i}`, 'YYYY MM Do');
    Severity: Major
    Found in src/app/legacy/psammead/psammead-locales/moment/ta.test.js and 1 other location - About 5 hrs to fix
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 577..598

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

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

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

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

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

    Refactorings

    Further Reading

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

    test('lenient day of month ordinal parsing of number', () => {
      let i;
      let testMoment;
      for (i = 1; i <= 31; i += 1) {
        testMoment = moment(`2014 01 ${i}`, 'YYYY MM Do');
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 597..618

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

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

    test('weeks year starting sunday', () => {
      assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan  1 2012 should be week 1');
      assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan  7 2012 should be week 1');
      assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan  8 2012 should be week 2');
      assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 512..522
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 459..465
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 532..542

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

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

    test('weeks year starting sunday', () => {
      assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1');
      assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1');
      assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2');
      assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');
    Severity: Major
    Found in src/app/legacy/psammead/psammead-locales/moment/ta.test.js and 3 other locations - About 5 hrs to fix
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 439..445
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 512..522
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 532..542

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

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

    test('weeks year starting saturday', () => {
      assert.equal(
        moment([2010, 11, 26]).week(),
        1,
        'Dec 26 2010 should be week 1'
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 439..445
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 459..465
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 532..542

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

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

    test('weeks year starting saturday', () => {
      assert.equal(
        moment([2010, 11, 26]).week(),
        1,
        'Dec 26 2010 should be week 1'
    Severity: Major
    Found in src/app/legacy/psammead/psammead-locales/moment/ta.test.js and 3 other locations - About 5 hrs to fix
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 439..445
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 512..522
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 459..465

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

    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 az.test.js has 412 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import moment from 'moment';
    import './az';
    
    moment.locale('az');
    
    
    Severity: Minor
    Found in src/app/legacy/psammead/psammead-locales/moment/az.test.js - About 5 hrs to fix

      File en-gb.test.js has 412 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import moment from 'moment';
      import './en-gb';
      
      moment.locale('en-gb');
      
      
      Severity: Minor
      Found in src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js - About 5 hrs to fix

        File zh-tw.test.js has 411 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import moment from 'moment';
        import './zh-tw';
        
        moment.locale('zh-tw');
        
        
        Severity: Minor
        Found in src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js - About 5 hrs to fix

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

            describe('Footer', () => {
              describe('Cookie Settings Button', () => {
                const button = document.querySelector(
                  'footer [data-testid="amp-cookie-settings-button"]',
                );
          Severity: Major
          Found in src/integration/common/footer.amp.js and 1 other location - About 5 hrs to fix
          src/integration/common/flourishEmbed.amp.js on lines 13..31

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

          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

                embedErrorMessages.forEach(errorEmbed => {
                  describe('Link', () => {
                    const linkEl = errorEmbed.querySelector('a');
                    const text = linkEl.textContent;
                    const url = linkEl.getAttribute('href');
          Severity: Major
          Found in src/integration/common/flourishEmbed.amp.js and 1 other location - About 5 hrs to fix
          src/integration/common/footer.amp.js on lines 2..26

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

          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('for cps asset pages', () => {
                it('should respond with JSON', async () => {
                  const { body } = await makeRequest('/pidgin/tori-49450859.json');
                  expect(body.data.article).toEqual(
                    expect.objectContaining({ content: expect.any(Object) }),
          Severity: Major
          Found in src/server/index.test.jsx and 1 other location - About 5 hrs to fix
          src/server/index.test.jsx on lines 1120..1138

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

          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('for legacy asset pages', () => {
                it('should respond with JSON', async () => {
                  const { body } = await makeRequest(
                    '/hausa/multimedia/2012/07/120712_click.json',
                  );
          Severity: Major
          Found in src/server/index.test.jsx and 1 other location - About 5 hrs to fix
          src/server/index.test.jsx on lines 1103..1118

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

          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 uz.test.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import moment from 'moment';
          import './uz';
          
          moment.locale('uz');
          
          
          Severity: Minor
          Found in src/app/legacy/psammead/psammead-locales/moment/uz.test.js - About 5 hrs to fix

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

            import moment from 'moment';
            import './pcm';
            
            moment.locale('pcm');
            
            
            Severity: Minor
            Found in src/app/legacy/psammead/psammead-locales/moment/pcm.test.js - About 5 hrs to fix

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

              import moment from 'moment';
              import './ig';
              
              moment.locale('ig');
              
              
              Severity: Minor
              Found in src/app/legacy/psammead/psammead-locales/moment/ig.test.js - About 5 hrs to fix

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

                test('format', () => {
                  const a = [
                    ['LL', '14 Ukwa kabiri 2010'],
                    ['D MMMM YYYY', '14 Ukwa kabiri 2010'],
                  ];
                Severity: Major
                Found in src/app/legacy/psammead/psammead-locales/moment/rw.test.js and 5 other locations - About 5 hrs to fix
                src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 11..22

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

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

                test('format', () => {
                  const a = [
                    ['LL', '14 ለካቲት 2010'],
                    ['D MMMM YYYY', '14 ለካቲት 2010'],
                  ];
                Severity: Major
                Found in src/app/legacy/psammead/psammead-locales/moment/ti.test.js and 5 other locations - About 5 hrs to fix
                src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/so.test.js on lines 11..21

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

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

                test('format', () => {
                  const a = [
                    ['LL', '14 Febraayo 2010'],
                    ['D MMMM YYYY', '14 Febraayo 2010'],
                  ];
                Severity: Major
                Found in src/app/legacy/psammead/psammead-locales/moment/so.test.js and 5 other locations - About 5 hrs to fix
                src/app/legacy/psammead/psammead-locales/moment/am.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/ha.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/om.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/rw.test.js on lines 11..21
                src/app/legacy/psammead/psammead-locales/moment/ti.test.js on lines 11..22

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

                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