martinmicunda/employee-scheduling-ui

View on GitHub
src/app/components/header/header.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

File header.spec.js has 261 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/header/header.spec.js - About 2 hrs to fix

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

                describe('Partners', () => {
                    it('should contain Partners label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.ADMIN});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(5) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 1 other location - About 3 days to fix
    src/app/components/header/header.spec.js on lines 101..142

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

    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('Employees', () => {
                    it('should contain Employees label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.ADMIN});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(4) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 1 other location - About 3 days to fix
    src/app/components/header/header.spec.js on lines 144..185

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

    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('Reports', () => {
                    it('should contain Reports label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.ADMIN});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(6) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 1 other location - About 3 days to fix
    src/app/components/header/header.spec.js on lines 248..289

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

    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('App Settings', () => {
                    it('should contain App Settings label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.ADMIN});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.dropdown-menu li:nth-child(2) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 1 other location - About 3 days to fix
    src/app/components/header/header.spec.js on lines 187..228

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

    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('Schedule', () => {
                    it('should contain Schedule label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.EMPLOYEE});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(1) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 3 other locations - About 1 day to fix
    src/app/components/header/header.spec.js on lines 65..81
    src/app/components/header/header.spec.js on lines 83..99
    src/app/components/header/header.spec.js on lines 230..246

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

    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('Documents', () => {
                    it('should contain Documents label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.EMPLOYEE});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(3) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 3 other locations - About 1 day to fix
    src/app/components/header/header.spec.js on lines 47..63
    src/app/components/header/header.spec.js on lines 65..81
    src/app/components/header/header.spec.js on lines 230..246

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

    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('Availability', () => {
                    it('should contain Availability label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.EMPLOYEE});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.navbar-nav.navbar-left li:nth-child(2) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 3 other locations - About 1 day to fix
    src/app/components/header/header.spec.js on lines 47..63
    src/app/components/header/header.spec.js on lines 83..99
    src/app/components/header/header.spec.js on lines 230..246

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

    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('My Account', () => {
                    it('should contain My Account label', () => {
                        spyOn(AuthenticationService, 'getCurrentUser').and.returnValue({role: USER_ROLES.ADMIN});
                        element = render();
                        const nav = angular.element(element[0].querySelector('.dropdown-menu li:nth-child(1) a'));
    Severity: Major
    Found in src/app/components/header/header.spec.js and 3 other locations - About 1 day to fix
    src/app/components/header/header.spec.js on lines 47..63
    src/app/components/header/header.spec.js on lines 65..81
    src/app/components/header/header.spec.js on lines 83..99

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

    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