martinmicunda/employee-scheduling-ui

View on GitHub
src/app/components/modal-availability/modal-availability.spec.js

Summary

Maintainability
D
1 day
Test Coverage

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

        it('should have saveButtonOptions property', () => {
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            spyOn(FormService, 'getModalSaveButtonOptions').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

src/app/components/employee-account-details/employee-account-details.spec.js on lines 525..533

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

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

        it('should have availability property', () => {
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

            expect(availabilityModal.availability).toEqual(itemMock);
src/app/components/modal-availability/modal-availability.spec.js on lines 70..76
src/app/components/modal-document/modal-document.spec.js on lines 296..302
src/app/components/modal-document/modal-document.spec.js on lines 304..310
src/app/components/modal-document/modal-document.spec.js on lines 312..318
src/app/components/modal-document/modal-document.spec.js on lines 344..350
src/app/components/modal-message/modal-message.spec.js on lines 216..222
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 382..388
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 402..408

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

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

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

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

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

Refactorings

Further Reading

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

        it('should cancel modal', () => {
            spyOn(fakeModal, 'dismiss');
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

src/app/components/modal-document/modal-document.spec.js on lines 387..395
src/app/components/modal-message/modal-message.spec.js on lines 246..254

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

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

        it('should have modal property', () => {
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

            expect(availabilityModal.modal).toEqual(fakeModal);
src/app/components/modal-availability/modal-availability.spec.js on lines 78..84
src/app/components/modal-document/modal-document.spec.js on lines 296..302
src/app/components/modal-document/modal-document.spec.js on lines 304..310
src/app/components/modal-document/modal-document.spec.js on lines 312..318
src/app/components/modal-document/modal-document.spec.js on lines 344..350
src/app/components/modal-message/modal-message.spec.js on lines 216..222
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 382..388
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 402..408

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

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 have isSubmitting property', () => {
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

            expect(availabilityModal.isSubmitting).toEqual(null);
src/app/components/modal-availability/modal-availability.spec.js on lines 124..129

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

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 have result property', () => {
            spyOn(AvailabilityModel, 'getItem').and.returnValue(itemMock);
            availabilityModal = new AvailabilityModal(ModalModel, AvailabilityModel, FormService, AvailabilityService, AvailabilityResource);

            expect(availabilityModal.result).toEqual(null);
src/app/components/modal-availability/modal-availability.spec.js on lines 117..122

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

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

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

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

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

Refactorings

Further Reading

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

            return availabilityModal.save(form).then(() => {
                expect(form.$setPristine).toHaveBeenCalled();
                expect(FormService.onFailure).toHaveBeenCalledWith(availabilityModal, 'error');
            });
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 500..503
src/app/routes/layout-app/account/contact-details/contact-details.spec.js on lines 299..302

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

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