src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js

Summary

Maintainability
F
2 wks
Test Coverage

File pt-br.test.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import moment from 'moment';
import './pt-br';

moment.locale('pt-br');

Severity: Minor
Found in src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js - About 6 hrs to fix

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

    test('from', () => {
      const start = moment([2007, 1, 28]);
      assert.equal(
        start.from(moment([2007, 1, 28]).add({ s: 44 }), true),
        'poucos segundos',
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 152..294
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 136..278
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 140..282
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 141..283
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 140..282
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 142..284
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 139..281
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 143..285
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 141..283
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 173..315
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 139..281
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 146..288
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 141..283
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 141..283
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 136..278
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 197..339
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 105..247
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 110..252
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 143..285
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 143..285

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

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

    test('format ordinal', () => {
      assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
      assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
      assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
      assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 91..126
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 88..123
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 8..43
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 69..104
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 73..108
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 73..108
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 75..110
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 72..107
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 76..111
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 72..107
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 108..143
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 79..114
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 69..104
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 74..109
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 79..114
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 63..98
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 76..111
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 76..111

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

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

    test('calendar day', () => {
      const calendarTime = moment().hours(12).minutes(0).seconds(0);
    
      assert.equal(
        moment(calendarTime).calendar(),
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 318..351
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 316..349
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 206..239
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 312..345
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 303..336
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 306..339
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 312..341
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 305..338
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 309..342
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 303..336
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 339..372
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 309..342
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 312..345
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 307..340
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 307..340
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 322..354
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 367..392
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 271..304
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 276..305
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 313..346
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 309..342

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

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

    test('calendar next week', () => {
      let i;
      let m;
      for (i = 2; i < 7; i += 1) {
        m = moment().add({ d: i });
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 353..376
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 378..401
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 351..374
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 376..399
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 241..264
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 266..290
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 347..370
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 372..396
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 338..361
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 363..387
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 343..366
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 368..392
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 340..363
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 365..389
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 344..367
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 369..393
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 338..361
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 363..386
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 374..397
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 399..423
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 344..367
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 369..393
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 347..370
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 372..396
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 356..379
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 381..405
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 394..417
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 419..443
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 306..329
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 331..354
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 307..330
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 332..356
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 348..371
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 373..397
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 344..368
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 370..394

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

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

    test('calendar all else', () => {
      let weeksAgo = moment().subtract({ w: 1 });
      let weeksFromNow = moment().add({ w: 1 });
    
      assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago');
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 403..415
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 401..413
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 292..304
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 398..410
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 398..410
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 389..401
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 394..406
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 391..403
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 395..407
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 388..400
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 425..437
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 395..407
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 670..682
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 398..410
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 426..438
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 426..438
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 407..419
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 445..457
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 356..368
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 448..460
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 358..370
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 399..411
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 396..408

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

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

    test('weeks year starting sunday format', () => {
      assert.equal(
        moment([2012, 0, 1]).format('w ww wo'),
        '1 01 1º',
        'Jan  1 2012 should be week 1'
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 440..466
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 415..441
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 338..364
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 412..438
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 412..438
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 431..457
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 436..462
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 408..434
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 405..431
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 457..483
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 434..460
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 524..550
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 409..435
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 684..710
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 440..466
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 440..466
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 421..447
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 544..570
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 370..396
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 462..488
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 372..398
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 413..439
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 410..436

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

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

    test('format week', () => {
      const expected =
        'domingo dom do_segunda-feira seg 2ª_terça-feira ter 3ª_quarta-feira qua 4ª_quinta-feira qui 5ª_sexta-feira sex 6ª_sábado sáb sá'.split(
          '_'
        );
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 137..150
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 140..153
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 121..134
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 125..138
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 126..139
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 127..140
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 124..137
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 128..141
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 126..139
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 158..171
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 124..137
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 284..297
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 131..144
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 126..139
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 126..139
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 121..134
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 182..195
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 90..103
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 157..170
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 128..141
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 128..141

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

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

    test('format month', () => {
      const expected =
        'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split(
          '_'
        );
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 125..138
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 106..119
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 110..123
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 111..124
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 112..125
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 109..122
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 113..126
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 111..124
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 143..156
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 109..122
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 145..158
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 116..129
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 111..124
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 111..124
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 106..119
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 167..180
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 75..88
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 116..129
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 113..126
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 113..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 97.

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

    test('fromNow', () => {
      assert.equal(
        moment().add({ s: 30 }).fromNow(),
        'em poucos segundos',
        'in seconds'
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 309..316
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 307..314
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 197..204
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 297..304
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 298..301
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 297..304
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 303..310
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 296..303
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 300..307
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 298..301
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 330..337
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 300..307
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 303..310
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 298..305
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 298..305
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 354..365
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 262..269
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 331..338
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 267..274
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 300..311
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 300..307

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

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

    test.each(a)('format %s', (formatString, expectedDate) => {
      const b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
      assert.equal(
        b.format(formatString),
        expectedDate,
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 67..74
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 65..72
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 65..72

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

    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

        assert.equal(
          m.calendar(),
          m.format(
            m.day() === 0 || m.day() === 6
              ? '[Último] dddd [às] LT'
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 363..371
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 373..381

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

    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

        assert.equal(
          m.calendar(),
          m.format(
            m.day() === 0 || m.day() === 6
              ? '[Último] dddd [às] LT'
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 373..381
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 383..391

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

    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

        assert.equal(
          m.calendar(),
          m.format(
            m.day() === 0 || m.day() === 6
              ? '[Último] dddd [às] LT'
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 363..371
    src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 383..391

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

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

    test('suffix', () => {
      assert.equal(moment(30000).from(0), 'em poucos segundos', 'prefix');
      assert.equal(moment(0).from(30000), 'Há poucos segundos', 'prefix');
    });
    src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
    src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
    src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
    src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
    src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
    src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290

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

    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

    There are no issues that match your filters.

    Category
    Status