KennethanCeyer/pg-calendar

View on GitHub

Showing 72 of 72 total issues

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

        const firstDate = moment(Math.max(local.current[0].valueOf(), local.dateManager.date.clone().startOf('month').valueOf()));
Severity: Major
Found in src/js/methods/init.js and 1 other location - About 1 hr to fix
src/js/methods/init.js on lines 189..189

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

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

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

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

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

Refactorings

Further Reading

Function generateDateRange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      const generateDateRange = () => {
        if (
          !local.current[0] ||
          !local.current[1]
        ) {
Severity: Minor
Found in src/js/methods/init.js - About 1 hr to fix

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

          context.settings.weeks = global.languages.weeks[context.settings.lang] ||
            global.languages.weeks[language.defaultLanguage];
    Severity: Major
    Found in src/js/methods/configure.js and 2 other locations - About 1 hr to fix
    src/js/methods/configure.js on lines 28..29
    src/js/methods/configure.js on lines 31..32

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

    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

          context.settings.months = global.languages.months[context.settings.lang] ||
            global.languages.months[language.defaultLanguage];
    Severity: Major
    Found in src/js/methods/configure.js and 2 other locations - About 1 hr to fix
    src/js/methods/configure.js on lines 25..26
    src/js/methods/configure.js on lines 28..29

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 59.

    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

          context.settings.monthsLong = global.languages.monthsLong[context.settings.lang] ||
            global.languages.monthsLong[language.defaultLanguage];
    Severity: Major
    Found in src/js/methods/configure.js and 2 other locations - About 1 hr to fix
    src/js/methods/configure.js on lines 25..26
    src/js/methods/configure.js on lines 31..32

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

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

        it('the year of `moment(\'2017-01-02\')` must be `2017`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.year).to.equal(2017);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

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

        it('the week day of `moment(\'2017-01-02\')` must be `1`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.weekDay).to.equal(1);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

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

        it('the first day of `moment(\'2017-01-02\')` must be `1`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.firstDay).to.equal(1);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

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

        it('the month of `moment(\'2017-01-02\')` must be `1`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.month).to.equal(1);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

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

        it('the day of `moment(\'2017-01-02\')` must be `2`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.day).to.equal(2);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

    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

        if (settings.format) {
          if (typeof settings.format === 'string') {
            global.format = settings.format;
          }
          else {
    Severity: Major
    Found in src/js/methods/setting.js and 1 other location - About 1 hr to fix
    src/js/methods/setting.js on lines 103..110

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

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

        it('the prev month of `moment(\'2017-01-02\')` must be `12`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.prevMonth).to.equal(12);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 76..80

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

    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

        if (settings.week) {
          if (typeof settings.week === 'number') {
            global.week = settings.week;
          }
          else {
    Severity: Major
    Found in src/js/methods/setting.js and 1 other location - About 1 hr to fix
    src/js/methods/setting.js on lines 112..119

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

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

        it('the last day of `moment(\'2017-01-02\')` must be `31`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.lastDay).to.equal(31);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74
    src/js/manager/index.spec.js on lines 76..80

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

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

        it('the next month of `moment(\'2017-01-02\')` must be `2`', () => {
          const date = moment('2017-01-02');
          const dateManager = new DateManager(date);
          expect(dateManager.nextMonth).to.equal(2);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 1 hr to fix
    src/js/manager/index.spec.js on lines 34..38
    src/js/manager/index.spec.js on lines 40..44
    src/js/manager/index.spec.js on lines 46..50
    src/js/manager/index.spec.js on lines 52..56
    src/js/manager/index.spec.js on lines 58..62
    src/js/manager/index.spec.js on lines 64..68
    src/js/manager/index.spec.js on lines 70..74

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 58.

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

        it('the first day of `2017-01-02` must be `1`', () => {
          const date = '2017-01-02';
          const dateManager = new DateManager(date);
          expect(dateManager.firstDay).to.equal(1);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 55 mins to fix
    src/js/manager/index.spec.js on lines 102..106
    src/js/manager/index.spec.js on lines 108..112
    src/js/manager/index.spec.js on lines 114..118
    src/js/manager/index.spec.js on lines 126..130
    src/js/manager/index.spec.js on lines 132..136
    src/js/manager/index.spec.js on lines 138..142
    src/js/manager/index.spec.js on lines 144..148

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

    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

                    if (local.current[1] !== null) {
                      dateValues.push(local.current[1].format(context.settings.format));
                    }
    Severity: Major
    Found in src/js/methods/init.js and 3 other locations - About 55 mins to fix
    src/js/methods/init.js on lines 347..349
    src/js/methods/init.js on lines 627..629
    src/js/methods/init.js on lines 631..633

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

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

        it('the week day of `2017-01-02` must be `1`', () => {
          const date = '2017-01-02';
          const dateManager = new DateManager(date);
          expect(dateManager.weekDay).to.equal(1);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 55 mins to fix
    src/js/manager/index.spec.js on lines 102..106
    src/js/manager/index.spec.js on lines 108..112
    src/js/manager/index.spec.js on lines 114..118
    src/js/manager/index.spec.js on lines 120..124
    src/js/manager/index.spec.js on lines 126..130
    src/js/manager/index.spec.js on lines 138..142
    src/js/manager/index.spec.js on lines 144..148

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

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

        it('the prev month of `1483315200000` must be `12`', () => {
          const date = 1483315200000;
          const dateManager = new DateManager(date);
          expect(dateManager.prevMonth).to.equal(12);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 55 mins to fix
    src/js/manager/index.spec.js on lines 170..174
    src/js/manager/index.spec.js on lines 176..180
    src/js/manager/index.spec.js on lines 182..186
    src/js/manager/index.spec.js on lines 188..192
    src/js/manager/index.spec.js on lines 194..198
    src/js/manager/index.spec.js on lines 200..204
    src/js/manager/index.spec.js on lines 212..216

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

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

        it('the year of `1483315200000` must be `2017`', () => {
          const date = 1483315200000;
          const dateManager = new DateManager(date);
          expect(dateManager.year).to.equal(2017);
        });
    Severity: Major
    Found in src/js/manager/index.spec.js and 7 other locations - About 55 mins to fix
    src/js/manager/index.spec.js on lines 176..180
    src/js/manager/index.spec.js on lines 182..186
    src/js/manager/index.spec.js on lines 188..192
    src/js/manager/index.spec.js on lines 194..198
    src/js/manager/index.spec.js on lines 200..204
    src/js/manager/index.spec.js on lines 206..210
    src/js/manager/index.spec.js on lines 212..216

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

    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