martinmicunda/employee-scheduling-ui

View on GitHub

Showing 438 of 458 total issues

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

@RouteConfig('app.settings.locations', {
    url: '/locations',
    template: '<locations></locations>',
    resolve: {
        init: ['LocationModel', LocationModel => LocationModel.initCollection()]
Severity: Major
Found in src/app/routes/layout-app/settings/locations/locations.js and 1 other location - About 2 hrs to fix
src/app/routes/layout-app/settings/positions/positions.js on lines 14..39

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

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 close the Error modal when `Close` button is clicked', () => {
                spyOn(vm, 'cancel');
                element = render();
                angular.element(element[0].getElementsByClassName('btn-white')).triggerHandler('click');

Severity: Major
Found in src/app/components/modal-error/modal-error.spec.js and 1 other location - About 2 hrs to fix
src/app/components/modal-error/modal-error.spec.js on lines 81..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 80.

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 close the Error modal when `×` button is clicked', () => {
                spyOn(vm, 'cancel');
                element = render();
                angular.element(element[0].getElementsByClassName('close')).triggerHandler('click');

Severity: Major
Found in src/app/components/modal-error/modal-error.spec.js and 1 other location - About 2 hrs to fix
src/app/components/modal-error/modal-error.spec.js on lines 95..101

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

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 get modal saveButtonOptions`, () => {
        let saveButtonOptionsCloned = Object.assign({}, saveButtonOptions);
        saveButtonOptionsCloned.animationCompleteTime = '0';
        saveButtonOptionsCloned.buttonErrorClass = 'btn-success';

Severity: Major
Found in src/app/core/services/form.spec.js and 1 other location - About 2 hrs to fix
src/app/core/services/form.spec.js on lines 42..48

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

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 return error message for 409 PUT error response`, () => {
            let self = {}, response = {status: 409, config: {method: 'PUT'}};

            formService.onFailure(self, response);

Severity: Major
Found in src/app/core/services/form.spec.js and 1 other location - About 2 hrs to fix
src/app/core/services/form.spec.js on lines 130..136

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

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 get saveButtonOptions`, () => {
        let saveButtonOptionsCloned = Object.assign({}, saveButtonOptions);
        saveButtonOptionsCloned.animationCompleteTime = '1200';
        saveButtonOptionsCloned.buttonErrorClass = 'btn-danger';

Severity: Major
Found in src/app/core/services/form.spec.js and 1 other location - About 2 hrs to fix
src/app/core/services/form.spec.js on lines 34..40

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

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 return error message for 409 POST error response`, () => {
            let self = {}, response = {status: 409, config: {method: 'POST'}};

            formService.onFailure(self, response);

Severity: Major
Found in src/app/core/services/form.spec.js and 1 other location - About 2 hrs to fix
src/app/core/services/form.spec.js on lines 122..128

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

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

    updatePassword(credentials, id) {
        const encoded = this.$window.btoa(JSON.stringify(credentials));
        return this.http.put(`/${this.route}/password/${id}`, {credentials: encoded});
    }
Severity: Major
Found in src/app/core/resources/authentication/authentication.js and 1 other location - About 2 hrs to fix
src/app/core/resources/authentication/authentication.js on lines 37..40

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

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

    resetPassword(credentials, token) {
        const encoded = this.$window.btoa(JSON.stringify(credentials));
        return this.http.post(`/${this.route}/password/${token}`, {credentials: encoded});
    }
Severity: Major
Found in src/app/core/resources/authentication/authentication.js and 1 other location - About 2 hrs to fix
src/app/core/resources/authentication/authentication.js on lines 42..45

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(25, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(25, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(17, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(17, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(3, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().add(3, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().subtract(14, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().subtract(14, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(45, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(45, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(47, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(47, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(18, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(18, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(44, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(44, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(23, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().add(23, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().add(26, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(26, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

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

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

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

Refactorings

Further Reading

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

    {
        id: `${employeeId}::${moment().subtract(13, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().subtract(13, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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