martinmicunda/employee-scheduling-ui

View on GitHub
src/app/routes/layout-app/account/account-details/account-details.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

File account-details.spec.js has 375 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @author    Martin Micunda {@link http://martinmicunda.com}
 * @copyright Copyright (c) 2015, Martin Micunda
 * @license   GPL-3.0
 */

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

                describe('avatar', () => {
                    it('should have `Photo` label defined', () => {
                        element = render();
    
                        const parentElement = angular.element(element[0].querySelector('.img-circle')).parent().parent().parent();
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 69..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 659.

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

                describe('firstName', () => {
                    it('should have `First Name` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('input[name="firstName"][type="text"]')).parent().parent();
    
    
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 131..163
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 165..197
    src/app/components/modal-document/modal-document.spec.js on lines 137..169
    src/app/components/modal-location/modal-location.spec.js on lines 144..176
    src/app/components/modal-partner/modal-partner.spec.js on lines 168..200
    src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 186..218

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

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

                describe('lastName', () => {
                    it('should have `Last Name` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('input[name="lastName"][type="text"]')).parent().parent();
    
    
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 131..163
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 165..197
    src/app/components/modal-document/modal-document.spec.js on lines 137..169
    src/app/components/modal-location/modal-location.spec.js on lines 144..176
    src/app/components/modal-partner/modal-partner.spec.js on lines 168..200
    src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 152..184

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

    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

                    xit('should show `email` unique error message', inject(($timeout, EmployeeResource) => {
                        spyOn(EmployeeResource, 'getEmployeeByEmail').and.returnValue(Promise.resolve());
                        element = render();
                        const inputField = angular.element(element[0].querySelector('input[name="email"][type="email"]'));
                        inputField.val(employee.email);
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 256..271

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

    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 show `email` maxlength error message', inject(($timeout) => {
                        element = render();
                        const inputField = angular.element(element[0].querySelector('input[name="email"][type="email"]'));
                        inputField.val('test@test.com' + CHARACTERS_61);
                        inputField.triggerHandler('input');
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 225..239

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

    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

            itAsync('should add new avatar image', () => {
                spyOn(Upload, 'dataUrl').and.returnValue(Promise.resolve('avatar-new'));
                spyOn(EmployeeModel, 'getItem').and.returnValue(itemMock);
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
    
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 589..600

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

    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 show `email` invalid error message', inject(($timeout) => {
                        element = render();
                        const inputField = angular.element(element[0].querySelector('input[name="email"][type="email"]'));
                        inputField.val('invalid-email');
                        inputField.triggerHandler('input');
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 241..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 162.

    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

        describe('Route', () => {
            let url = '/account/account-details',
                state = 'app.account.account-details',
                currentState,
                $state, $injector;
    src/app/routes/layout-app/account/contact-details/contact-details.spec.js on lines 16..36
    src/app/routes/layout-app/account/password/password.spec.js on lines 15..35
    src/app/routes/layout-auth/forgot-password/forgot-password.spec.js on lines 16..36
    src/app/routes/layout-auth/login/login.spec.js on lines 16..36

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

    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 default avatar image', () => {
                spyOn(EmployeeModel, 'getItem').and.returnValue(itemMock);
                spyOn(SettingModel, 'getItem').and.returnValue({avatar: 'avatar-default'});
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
    
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 576..587

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

    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();
    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-message/modal-message.spec.js on lines 120..128
    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/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 3 locations. Consider refactoring.
    Open

            it('should not save if form is invalid', () => {
                let form = {$valid: false};
                spyOn(FormService, 'save');
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
    
    src/app/components/modal-document/modal-document.spec.js on lines 398..407
    src/app/components/modal-message/modal-message.spec.js on lines 256..265

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

            it('should have employeeCloned property', () => {
                spyOn(EmployeeModel, 'getItem').and.returnValue(itemMock);
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
                expect(accountDetails.employeeCloned).toEqual(itemMock);
    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/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 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 9 locations. Consider refactoring.
    Open

            it('should have saveButtonOptions property', () => {
                spyOn(FormService, 'getSaveButtonOptions').and.returnValue(itemMock);
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
                expect(accountDetails.saveButtonOptions).toEqual(itemMock);
    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/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

    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

                return accountDetails.save(form).then(() => {
                    expect(form.$setPristine).toHaveBeenCalled();
                    expect(FormService.onFailure).toHaveBeenCalledWith(accountDetails, 'error');
                });
    src/app/components/modal-availability/modal-availability.spec.js on lines 208..211
    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

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

            it('should have `Account Details` title defined', () => {
                element = render();
                const title = element.find('h4');
    
                expect(title.text()).toEqual('Account Details');
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 58..63
    src/app/components/employee-bank-details/employee-bank-details.spec.js on lines 43..48
    src/app/components/employee-contact-details/employee-contact-details.spec.js on lines 43..48
    src/app/components/employee-hourly-rate/employee-hourly-rate.spec.js on lines 44..49
    src/app/routes/layout-app/account/contact-details/contact-details.spec.js on lines 62..67
    src/app/routes/layout-app/account/password/password.spec.js on lines 61..66
    src/app/routes/layout-app/employees/edit/password/password.spec.js on lines 67..72
    src/app/routes/layout-app/employees/edit/password/password.spec.js on lines 74..79

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

    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

            beforeEach(inject((_FormService_, _EmployeeModel_, _SettingModel_, _Upload_, _EmployeeResource_) => {
                Upload = _Upload_;
                FormService = _FormService_;
                SettingModel = _SettingModel_;
                EmployeeModel = _EmployeeModel_;
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 490..496
    src/app/components/modal-document/modal-document.spec.js on lines 288..294

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

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

            it('should have `mm-modal-warning-unsaved-form` component defined', () => {
                element = render();
    
                expect(element.find('form').attr('mm-modal-warning-unsaved-form')).toBeDefined();
            });
    src/app/routes/layout-app/account/contact-details/contact-details.spec.js on lines 77..81

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

    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', () => {
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
                expect(accountDetails.isSubmitting).toEqual(null);
            });
    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/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 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', () => {
                accountDetails = new AccountDetails(EmployeeModel, SettingModel, Upload, FormService, EmployeeResource);
    
                expect(accountDetails.result).toEqual(null);
            });
    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/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/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