martinmicunda/employee-scheduling-ui

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

Summary

Maintainability
F
2 wks
Test Coverage

File modal-document.spec.js has 368 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
 */
Severity: Minor
Found in src/app/components/modal-document/modal-document.spec.js - About 4 hrs to fix

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

                describe('name', () => {
                    it('should have `Name` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('input[name="name"][type="text"]')).parent().parent();
    
    
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 6 other locations - About 2 days to fix
    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-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
    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 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-document/modal-document.spec.js and 4 other locations - About 1 day to fix
    src/app/components/modal-location/modal-location.spec.js on lines 72..102
    src/app/components/modal-message/modal-message.spec.js on lines 66..96
    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

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

                    it('should show dropdown options order by firstName', () => {
                        const employeesWithAccess = [{id: '1', firstName: 'B', lastName: 'test'}, {id: '2', firstName: 'A', lastName: 'test'}, {id: '3', firstName: 'C', lastName: 'test'}],
                            employeesWithAccessOrdered = [employeesWithAccess[1], employeesWithAccess[0], employeesWithAccess[2]];
                        element = render();
                        element.isolateScope().vm.document.isLocked = true;
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 day to fix
    src/app/components/modal-document/modal-document.spec.js on lines 217..234

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

    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 dropdown options order by firstName', () => {
                        const employeesWithoutAccess = [{id: '1', firstName: 'B', lastName: 'test'}, {id: '2', firstName: 'A', lastName: 'test'}, {id: '3', firstName: 'C', lastName: 'test'}],
                            employeesWithoutAccessOrdered = [employeesWithoutAccess[1], employeesWithoutAccess[0], employeesWithoutAccess[2]];
                        element = render();
                        element.isolateScope().vm.document.isLocked = true;
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 day to fix
    src/app/components/modal-document/modal-document.spec.js on lines 245..262

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

    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

            describe('addAccess', () => {
                it('should add employees with access', () => {
                    const employeesWithAccessClone = 'employeesWithAccessClone', employeesWithAccess = 'employeesWithAccess', selectedEmployeeWithoutAccess = 'selectedEmployeeWithoutAccess', employeesWithoutAccess = 'employeesWithoutAccess';
                    spyOn(DocumentService, 'grantAccess').and.returnValue(employeesWithAccessClone);
    
    
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 day to fix
    src/app/components/modal-document/modal-document.spec.js on lines 480..507

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

    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

            describe('removeAccess', () => {
                it('should remove employees with access', () => {
                    const employeesWithoutAccessClone = 'employeesWithoutAccessClone', employeesWithAccess = 'employeesWithAccess', selectedEmployeeWithAccess = 'selectedEmployeeWithAccess', employeesWithoutAccess = 'employeesWithoutAccess';
                    spyOn(DocumentService, 'grantAccess').and.returnValue(employeesWithoutAccessClone);
    
    
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 day to fix
    src/app/components/modal-document/modal-document.spec.js on lines 451..478

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

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

            describe('Show title', () => {
                it('should have `Edit Folder` modal title defined when location ID exist', () => {
                    spyOn(DocumentModel, 'getItem').and.returnValue(document);
                    element = render();
                    const title = element.find('h4');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 3 other locations - About 7 hrs to fix
    src/app/components/modal-location/modal-location.spec.js on lines 54..70
    src/app/components/modal-partner/modal-partner.spec.js on lines 54..70
    src/app/components/modal-position/modal-position.spec.js on lines 53..69

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

    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 select dropdown options when isLocked is clicked', () => {
                        spyOn(DocumentModel, 'getItem').and.returnValue({id: 'id'});
                        element = render();
                        element.isolateScope().vm.document.isLocked = true;
                        scope.$digest();
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 5 hrs to fix
    src/app/components/modal-document/modal-document.spec.js on lines 190..199

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

    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 not show select dropdown options when isLocked is not clicked', () => {
                        spyOn(DocumentModel, 'getItem').and.returnValue({id: 'id'});
                        element = render();
                        element.isolateScope().vm.document.isLocked = false;
                        scope.$digest();
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 5 hrs to fix
    src/app/components/modal-document/modal-document.spec.js on lines 179..188

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

    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-document/modal-document.spec.js and 9 other locations - About 5 hrs to fix
    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/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 4 locations. Consider refactoring.
    Open

            beforeEach(inject((_$compile_, _$rootScope_, _ModalModel_, _DocumentModel_) => {
                $compile = _$compile_;
                $rootScope = _$rootScope_;
                scope = $rootScope.$new();
                ModalModel = _ModalModel_;
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 3 other locations - About 5 hrs to fix
    src/app/components/modal-location/modal-location.spec.js on lines 21..37
    src/app/components/modal-partner/modal-partner.spec.js on lines 21..37
    src/app/components/modal-position/modal-position.spec.js on lines 20..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 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 call `vm.removeAccess` when arrow-left button is clicked', function () {
                element = render();
                spyOn(element.isolateScope().vm, 'removeAccess');
    
                angular.element(element[0].querySelector('i.fa-long-arrow-left')).parent().triggerHandler('click');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 3 hrs to fix
    src/app/components/modal-document/modal-document.spec.js on lines 266..273

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

    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 call `vm.addAccess` when arrow-right button is clicked', function () {
                element = render();
                spyOn(element.isolateScope().vm, 'addAccess');
    
                angular.element(element[0].querySelector('i.fa-long-arrow-right')).parent().triggerHandler('click');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 3 hrs to fix
    src/app/components/modal-document/modal-document.spec.js on lines 275..282

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

    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');
    
                    documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 3 hrs to fix
    src/app/components/modal-message/modal-message.spec.js on lines 267..277

    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');
                    documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
    
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 2 other locations - About 3 hrs to fix
    src/app/components/modal-message/modal-message.spec.js on lines 256..265
    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 `who has not access` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('select[name="selectedEmployeeWithoutAccess"]')).parent();
    
                        expect(parentElement.find('label').text()).toEqual('who has not access');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 4 other locations - About 2 hrs to fix
    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
    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 5 locations. Consider refactoring.
    Open

                    it('should have `who has access` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('select[name="selectedEmployeeWithAccess"]')).parent();
    
                        expect(parentElement.find('label').text()).toEqual('who has access');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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-message/modal-message.spec.js on lines 136..141
    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 5 locations. Consider refactoring.
    Open

                    it('should have `who has access` label defined', () => {
                        element = render();
                        const parentElement = angular.element(element[0].querySelector('select[name="selectedEmployeeWithAccess"]')).parent();
    
                        expect(parentElement.find('label').text()).toEqual('who has access');
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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 238..243
    src/app/components/modal-message/modal-message.spec.js on lines 136..141
    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);
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.modal).toEqual(itemMock);
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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 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 9 locations. Consider refactoring.
    Open

            it('should have document property', () => {
                spyOn(DocumentModel, 'getItem').and.returnValue(document);
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.document).toEqual(document);
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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 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 9 locations. Consider refactoring.
    Open

            it('should have saveButtonOptions property', () => {
                spyOn(FormService, 'getModalSaveButtonOptions').and.returnValue(itemMock);
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.saveButtonOptions).toEqual(itemMock);
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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-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(ModalModel, 'getItem').and.returnValue(fakeModal);
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
    
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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-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 employees property', () => {
                spyOn(EmployeeModel, 'getCollection').and.returnValue(itemMock);
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.employees).toEqual(itemMock);
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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 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

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

                const document = {id: 'id', employees: ['1', '2']}, employees = [{id: '1', name: 'name1'}, {id: '2', name: 'name2'}, {id: '3', name: 'name3'}];
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 hr to fix
    src/app/components/modal-document/modal-document.spec.js on lines 378..378

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

    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

                const document = {id: 'id', employees: ['1', '2']}, employees = [{id: '1', name: 'name1'}, {id: '2', name: 'name2'}, {id: '3', name: 'name3'}];
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 hr to fix
    src/app/components/modal-document/modal-document.spec.js on lines 368..368

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

    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_, _DocumentModel_, _ModalModel_, _EmployeeModel_, _DocumentService_) => {
                ModalModel = _ModalModel_;
                FormService = _FormService_;
                DocumentModel = _DocumentModel_;
                EmployeeModel = _EmployeeModel_;
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 2 other locations - About 1 hr to fix
    src/app/components/employee-account-details/employee-account-details.spec.js on lines 490..496
    src/app/routes/layout-app/account/account-details/account-details.spec.js on lines 364..370

    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

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

            it(`should have selectedEmployeeWithoutAccess set to empty array`, () => {
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.selectedEmployeeWithoutAccess.length).toEqual(0);
            });
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 hr to fix
    src/app/components/modal-document/modal-document.spec.js on lines 320..324

    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

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

            it(`should have selectedEmployeeWithAccess set to empty array`, () => {
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.selectedEmployeeWithAccess.length).toEqual(0);
            });
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 1 other location - About 1 hr to fix
    src/app/components/modal-document/modal-document.spec.js on lines 326..330

    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

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

            it('should have result property', () => {
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.result).toEqual(null);
            });
    Severity: Major
    Found in src/app/components/modal-document/modal-document.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-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/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 isSubmitting property', () => {
                documentModal = new DocumentModal(ModalModel, DocumentModel, EmployeeModel, DocumentService, FormService);
    
                expect(documentModal.isSubmitting).toEqual(null);
            });
    Severity: Major
    Found in src/app/components/modal-document/modal-document.spec.js and 7 other locations - About 35 mins to fix
    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/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