KennethanCeyer/pg-calendar

View on GitHub

Showing 55 of 72 total issues

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

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

                        if (local.current[0] !== null) {
                          dateValues.push(local.current[0].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 351..353
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 prev month of `2017-01-02` must be `12`', () => {
      const date = '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 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 132..136
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 351..353
src/js/methods/init.js on lines 627..629

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 `2017-01-02` must be `2017`', () => {
      const date = '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 55 mins to fix
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 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 8 locations. Consider refactoring.
Open

    it('the last day of `2017-01-02` must be `31`', () => {
      const date = '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 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 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

Severity
Category
Status
Source
Language