martinmicunda/employee-scheduling-ui

View on GitHub

Showing 438 of 458 total issues

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

    {
        id: `${employeeId}::${moment().subtract(17, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().subtract(17, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().subtract(18, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().subtract(18, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().subtract(20, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'necessary',
        date: moment().subtract(20, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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 `$rootScope.isLoading` to true when route contains resolve property', () => {
                const toState = {resolve: 'test'};
                OnRun.runFactory($rootScope, $state, $log, AuthenticationService);

                $rootScope.$broadcast('$stateChangeStart', toState); // the first argument is reserved for the event object (that's why we are not passing event object here)
Severity: Major
Found in src/app/core/config/config.spec.js and 1 other location - About 2 hrs to fix
src/app/core/config/config.spec.js on lines 186..193

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

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 `$rootScope.isLoading` to true when route contains resolve property', () => {
                const toState = {resolve: 'test'};
                OnRun.runFactory($rootScope, $state, $log, AuthenticationService);

                $rootScope.$broadcast('$stateChangeSuccess', toState); // the first argument is reserved for the event object (that's why we are not passing event object here)
Severity: Major
Found in src/app/core/config/config.spec.js and 1 other location - About 2 hrs to fix
src/app/core/config/config.spec.js on lines 83..90

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

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

    {
        id: `${employeeId}::${moment().add(14, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().add(14, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().add(24, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(24, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().add(46, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(46, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().add(12, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().add(12, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().subtract(12, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'unavailable',
        date: moment().subtract(12, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().subtract(21, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'necessary',
        date: moment().subtract(21, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 135..140
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

    {
        id: `${employeeId}::${moment().add(43, 'day').format('YYYYMMDD')}`,
        employeeId: employeeId,
        availability: 'available',
        date: moment().add(43, 'day').format('YYYYMMDD')
src/app/core/resources/availability/fixtures/availabilities.js on lines 32..37
src/app/core/resources/availability/fixtures/availabilities.js on lines 38..43
src/app/core/resources/availability/fixtures/availabilities.js on lines 51..56
src/app/core/resources/availability/fixtures/availabilities.js on lines 57..62
src/app/core/resources/availability/fixtures/availabilities.js on lines 63..68
src/app/core/resources/availability/fixtures/availabilities.js on lines 69..74
src/app/core/resources/availability/fixtures/availabilities.js on lines 75..80
src/app/core/resources/availability/fixtures/availabilities.js on lines 81..86
src/app/core/resources/availability/fixtures/availabilities.js on lines 87..92
src/app/core/resources/availability/fixtures/availabilities.js on lines 93..98
src/app/core/resources/availability/fixtures/availabilities.js on lines 99..104
src/app/core/resources/availability/fixtures/availabilities.js on lines 105..110
src/app/core/resources/availability/fixtures/availabilities.js on lines 111..116
src/app/core/resources/availability/fixtures/availabilities.js on lines 117..122
src/app/core/resources/availability/fixtures/availabilities.js on lines 123..128
src/app/core/resources/availability/fixtures/availabilities.js on lines 129..134
src/app/core/resources/availability/fixtures/availabilities.js on lines 141..146
src/app/core/resources/availability/fixtures/availabilities.js on lines 147..152
src/app/core/resources/availability/fixtures/availabilities.js on lines 153..158
src/app/core/resources/availability/fixtures/availabilities.js on lines 159..164

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

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

@RouteConfig('app.schedule', {
    url: '/schedule',
    template: '<schedule></schedule>',
    data: {
        access: ACCESS_LEVELS.employee
Severity: Major
Found in src/app/routes/layout-app/schedule/schedule.js and 1 other location - About 1 hr to fix
src/app/routes/layout-app/reports/reports.js on lines 13..27

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

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

                } else if (data.currentPassword.includes('404')) {
                    return [404];
                } else if (data.currentPassword.includes('409')) {
                    return [409];
                } else if (data.currentPassword.includes('500')) {
src/app/core/resources/authentication/authentication.mock.js on lines 70..76

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

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

                if(data.password.includes('400')) {
                    return [400];
                } else if (data.password.includes('404')) {
                    return [404];
                } else if (data.password.includes('500')) {
src/app/core/resources/authentication/authentication.mock.js on lines 90..96

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

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

@Component({
    selector: 'employee-bank-details'
})
@View({
    template: template
src/app/components/employee-contact-details/employee-contact-details.js on lines 12..24

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

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

@Component({
    selector: 'employee-contact-details'
})
@View({
    template: template
src/app/components/employee-bank-details/employee-bank-details.js on lines 12..24

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

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

@RouteConfig('app.reports', {
    url: '/reports',
    template: '<reports></reports>',
    data: {
        access: ACCESS_LEVELS.admin
Severity: Major
Found in src/app/routes/layout-app/reports/reports.js and 1 other location - About 1 hr to fix
src/app/routes/layout-app/schedule/schedule.js on lines 13..27

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

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

        return model.save(item).then(() => {
            this.onSuccess(self);
            return Promise.resolve();
        }, (response) => {
            this.onFailure(self, response);
Severity: Major
Found in src/app/core/services/form.js and 1 other location - About 1 hr to fix
src/app/core/services/form.js on lines 82..88

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

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

        return model.delete(item).then(() => {
            this.onSuccess(self);
            return Promise.resolve();
        },(response) => {
            this.onFailure(self, response);
Severity: Major
Found in src/app/core/services/form.js and 1 other location - About 1 hr to fix
src/app/core/services/form.js on lines 70..76

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

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

Severity
Category
Status
Source
Language