src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js

Summary

Maintainability
F
3 wks
Test Coverage

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

      describe('from', () => {
        const start = moment([2007, 1, 28]);
        assert.equal(
          start.from(moment([2007, 1, 28]).add({ s: 45 }), true),
          '1 分鐘',
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 155..292
    src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 45..182

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

    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

      describe('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/pt-br.test.js on lines 73..108
    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 18 locations. Consider refactoring.
    Open

      describe('parse', () => {
        const tests =
          '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split(
            '_'
          );
    src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 8..34
    src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 8..34
    src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 11..37
    src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 11..37

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

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

      describe('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/pt-br.test.js on lines 298..331
    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 39 locations. Consider refactoring.
    Open

      describe('calendar next week', () => {
        let i;
        let m;
    
        for (i = 2; i < 7; i += 1) {
    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/pt-br.test.js on lines 333..356
    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
    src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 367..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 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

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

      describe('calendar last week', () => {
        let i;
        let m;
    
        for (i = 2; i < 7; i += 1) {
    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/pt-br.test.js on lines 333..356
    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
    src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 341..365

    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

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

      describe('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/pt-br.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 25 locations. Consider refactoring.
    Open

      describe('weeks year starting sunday formatted', () => {
        assert.equal(
          moment([2012, 0, 1]).format('w ww wo'),
          '1 01 1週',
          'Jan  1 2012 應該是第 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/pt-br.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 23 locations. Consider refactoring.
    Open

      describe('format week', () => {
        const expected =
          '星期日 週日 日_星期一 週一 一_星期二 週二 二_星期三 週三 三_星期四 週四 四_星期五 週五 五_星期六 週六 六'.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/pt-br.test.js on lines 125..138
    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 22 locations. Consider refactoring.
    Open

      describe('format month', () => {
        const expected =
          '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.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/pt-br.test.js on lines 110..123
    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 23 locations. Consider refactoring.
    Open

      describe('fromNow', () => {
        assert.equal(
          moment().add({ s: 30 }).fromNow(),
          '幾秒後',
          'in a few 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/pt-br.test.js on lines 289..296
    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

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

      describe.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/pt-br.test.js on lines 64..71
    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 26 locations. Consider refactoring.
    Open

      describe('suffix', () => {
        assert.equal(moment(30000).from(0), '幾秒後', 'prefix');
        assert.equal(moment(0).from(30000), '幾秒前', '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/pt-br.test.js on lines 284..287
    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