Innqube/ngx-iq-datepicker

View on GitHub
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts

Summary

Maintainability
D
2 days
Test Coverage

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

    it('should go to previous year if visible month is january', () => {
        component.date = new Date(2017, 0, 1);
        component.prevMonth();
        expect(component.date.getFullYear()).toBe(2016);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to next month', () => {
        component.date = new Date(2017, 5, 1);
        component.nextMonth();
        expect(component.date.getMonth()).toBe(6);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to first month if visible month is december', () => {
        component.date = new Date(2017, 11, 1);
        component.nextMonth();
        expect(component.date.getMonth()).toBe(0);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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

    it('should set view on next month if a date from next month is selected', () => {
        spyOn(component, 'nextMonth');
        component.date = new Date();
        component.onDateSelected(1, false, true);
        expect(component.nextMonth).toHaveBeenCalled();
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 103..108

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

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('should go to next year', () => {
        component.date = new Date(2017, 11, 1);
        component.nextYear();
        expect(component.date.getFullYear()).toBe(2018);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to previous month', () => {
        component.date = new Date(2017, 5, 1);
        component.prevMonth();
        expect(component.date.getMonth()).toBe(4);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to last month if visible month is january', () => {
        component.date = new Date(2017, 0, 1);
        component.prevMonth();
        expect(component.date.getMonth()).toBe(11);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to next year if visible month is december', () => {
        component.date = new Date(2017, 11, 1);
        component.nextMonth();
        expect(component.date.getFullYear()).toBe(2018);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 70..74
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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('should go to previous year', () => {
        component.date = new Date(2017, 11, 1);
        component.prevYear();
        expect(component.date.getFullYear()).toBe(2016);
    });
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 34..38
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 40..44
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 46..50
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 52..56
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 58..62
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 64..68
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts 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 66.

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

    it('should set view on previous month if a date from previous month is selected', () => {
        spyOn(component, 'prevMonth');
        component.date = new Date();
        component.onDateSelected(30, true, false);
        expect(component.prevMonth).toHaveBeenCalled();
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 110..115

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

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

    it('should update calendar when month is selected', () => {
        spyOn(component, 'updateViewDays');
        component.date = new Date();
        component.selectMonth(2);
        expect(component.updateViewDays).toHaveBeenCalled();
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 89..94

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

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

    it('should update calendar when year is selected', () => {
        spyOn(component, 'updateViewDays');
        component.date = new Date();
        component.setYear(2020);
        expect(component.updateViewDays).toHaveBeenCalled();
src/app/component-wrapper/src/app/iq-calendar/iq-calendar.component.spec.ts on lines 82..87

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

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

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [IqCalendarComponent],
            imports: [
                TextMaskModule,
src/app/app.component.spec.ts on lines 8..18

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

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