martinmicunda/employee-scheduling-ui

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

Summary

Maintainability
F
4 days
Test Coverage

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

        describe('Close modal', () => {
            it('should have `×` label defined for close button', () => {
                element = render();

                expect(angular.element(element[0].querySelector('button.close')).text()).toEqual('×');
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 4 other locations - About 1 day to fix
src/app/components/modal-document/modal-document.spec.js on lines 71..101
src/app/components/modal-location/modal-location.spec.js on lines 72..102
src/app/components/modal-partner/modal-partner.spec.js on lines 72..102
src/app/components/modal-position/modal-position.spec.js on lines 71..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 347.

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

Identical blocks of code found in 10 locations. Consider refactoring.
Open

            it('should have `jp-ng-bs-animated-button` component defined with attributes `is-submitting`, `result` and `options`', () => {
                element = render();
                const saveButton = angular.element(element[0].querySelector('button.btn-success'));

                expect(saveButton[0]).toBeDefined();
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 9 other locations - About 5 hrs to fix
src/app/components/modal-document/modal-document.spec.js on lines 123..131
src/app/components/modal-location/modal-location.spec.js on lines 130..138
src/app/components/modal-partner/modal-partner.spec.js on lines 152..160
src/app/components/modal-position/modal-position.spec.js on lines 120..128
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 349..357
src/app/routes/layout-app/account/contact-details/contact-details.spec.js on lines 206..214
src/app/routes/layout-app/account/password/password.spec.js on lines 231..239
src/app/routes/layout-auth/forgot-password/forgot-password.spec.js on lines 95..103
src/app/routes/layout-auth/login/login.spec.js on lines 92..100

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

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 save if form is valid', () => {
            let form = {$valid: true};
            spyOn(FormService, 'save');

            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 1 other location - About 3 hrs to fix
src/app/components/modal-document/modal-document.spec.js on lines 409..419

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

        it('should not save if form is invalid', () => {
            let form = {$valid: false};
            spyOn(FormService, 'save');
            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);

Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 2 other locations - About 3 hrs to fix
src/app/components/modal-document/modal-document.spec.js on lines 398..407
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 443..452

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

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

                it('should have `Message` label defined', () => {
                    element = render();
                    const parentElement = angular.element(element[0].querySelector('textarea[name="body"]')).parent();

                    expect(parentElement.find('label').text()).toEqual('Message');
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 4 other locations - About 2 hrs to fix
src/app/components/modal-document/modal-document.spec.js on lines 203..208
src/app/components/modal-document/modal-document.spec.js on lines 210..215
src/app/components/modal-document/modal-document.spec.js on lines 238..243
src/app/components/modal-message/modal-message.spec.js on lines 136..141

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

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

                it('should have `Subject` label defined', () => {
                    element = render();
                    const parentElement = angular.element(element[0].querySelector('input[name="subject"][type="text"]')).parent();

                    expect(parentElement.find('label').text()).toEqual('Subject');
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 4 other locations - About 2 hrs to fix
src/app/components/modal-document/modal-document.spec.js on lines 203..208
src/app/components/modal-document/modal-document.spec.js on lines 210..215
src/app/components/modal-document/modal-document.spec.js on lines 238..243
src/app/components/modal-message/modal-message.spec.js on lines 170..175

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

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(ModalModel, 'getItem').and.returnValue(itemMock);
            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);

            expect(messageModal.modal).toEqual(itemMock);
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 8 other locations - About 2 hrs to fix
src/app/components/modal-availability/modal-availability.spec.js on lines 70..76
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/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(ModalModel, 'getItem').and.returnValue(fakeModal);
            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);

Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 2 other locations - About 2 hrs to fix
src/app/components/modal-availability/modal-availability.spec.js on lines 140..148
src/app/components/modal-document/modal-document.spec.js on lines 387..395

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

        it('should have isSubmitting property', () => {
            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);

            expect(messageModal.isSubmitting).toEqual(null);
        });
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 7 other locations - About 35 mins to fix
src/app/components/modal-document/modal-document.spec.js on lines 332..336
src/app/components/modal-document/modal-document.spec.js on lines 338..342
src/app/components/modal-message/modal-message.spec.js on lines 230..234
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 390..394
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 396..400
src/app/routes/layout-app/employees/add/add.spec.js on lines 112..116
src/app/routes/layout-app/employees/add/add.spec.js on lines 118..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 47.

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 have result property', () => {
            messageModal = new MessageModal(ModalModel, $rootScope, FormService, EmployeeModel, MessageModel);

            expect(messageModal.result).toEqual(null);
        });
Severity: Major
Found in src/app/components/modal-message/modal-message.spec.js and 7 other locations - About 35 mins to fix
src/app/components/modal-document/modal-document.spec.js on lines 332..336
src/app/components/modal-document/modal-document.spec.js on lines 338..342
src/app/components/modal-message/modal-message.spec.js on lines 224..228
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 390..394
src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 396..400
src/app/routes/layout-app/employees/add/add.spec.js on lines 112..116
src/app/routes/layout-app/employees/add/add.spec.js on lines 118..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 47.

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