gadael/gadael

View on GitHub
rest/admin/requests.js

Summary

Maintainability
C
1 day
Test Coverage

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

function createController() {
    ctrlFactory.create.call(this, '/rest/admin/requests');

    var controller = this;
    this.controllerAction = function() {
Severity: Major
Found in rest/admin/requests.js and 1 other location - About 3 hrs to fix
rest/admin/recoverquantities.js on lines 28..44

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

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

function updateController() {
    ctrlFactory.update.call(this, '/rest/admin/requests/:id');

    var controller = this;
    this.controllerAction = function() {
Severity: Major
Found in rest/admin/requests.js and 3 other locations - About 2 hrs to fix
rest/admin/invitations.js on lines 29..43
rest/admin/overtimes.js on lines 29..43
rest/admin/recoverquantities.js on lines 49..64

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

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

function deleteController() {
    ctrlFactory.delete.call(this, '/rest/admin/requests/:id');

    var controller = this;
    this.controllerAction = function() {
Severity: Major
Found in rest/admin/requests.js and 3 other locations - About 2 hrs to fix
rest/admin/overtimes.js on lines 57..66
rest/admin/overtimesummary.js on lines 13..21
rest/admin/recoverquantities.js on lines 67..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 81.

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

function getController() {
    ctrlFactory.get.call(this, '/rest/admin/requests/:id');

    this.controllerAction = function() {
        this.jsonService(this.service('user/requests/get', {
Severity: Major
Found in rest/admin/requests.js and 1 other location - About 1 hr to fix
rest/admin/collaborators.js on lines 6..12

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

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

function listController() {
    ctrlFactory.list.call(this, '/rest/admin/requests');

    this.controllerAction = function() {
        this.jsonService(this.service('user/requests/list'));
Severity: Major
Found in rest/admin/requests.js and 61 other locations - About 1 hr to fix
rest/admin/accountbeneficiaries.js on lines 6..12
rest/admin/accountbeneficiaries.js on lines 16..22
rest/admin/accountcollections.js on lines 6..12
rest/admin/accountcollections.js on lines 16..22
rest/admin/accountcollections.js on lines 42..48
rest/admin/accountnwdayscalendars.js on lines 6..12
rest/admin/accountnwdayscalendars.js on lines 16..22
rest/admin/accountnwdayscalendars.js on lines 42..48
rest/admin/accountschedulecalendars.js on lines 6..12
rest/admin/accountschedulecalendars.js on lines 16..22
rest/admin/accountschedulecalendars.js on lines 42..48
rest/admin/adjustments.js on lines 6..12
rest/admin/apitokens.js on lines 9..15
rest/admin/apitokens.js on lines 19..25
rest/admin/apitokens.js on lines 29..34
rest/admin/apitokens.js on lines 37..43
rest/admin/beneficiaries.js on lines 6..12
rest/admin/beneficiaries.js on lines 16..22
rest/admin/beneficiaries.js on lines 42..48
rest/admin/calendarevents.js on lines 6..12
rest/admin/calendars.js on lines 6..12
rest/admin/calendars.js on lines 16..22
rest/admin/calendars.js on lines 42..48
rest/admin/collections.js on lines 7..13
rest/admin/collections.js on lines 17..23
rest/admin/collections.js on lines 43..49
rest/admin/compulsoryleaves.js on lines 7..13
rest/admin/compulsoryleaves.js on lines 17..23
rest/admin/compulsoryleaves.js on lines 43..49
rest/admin/departments.js on lines 7..13
rest/admin/departments.js on lines 17..23
rest/admin/departments.js on lines 43..49
rest/admin/invitations.js on lines 7..13
rest/admin/invitations.js on lines 17..23
rest/admin/invitations.js on lines 57..63
rest/admin/lunchs.js on lines 4..10
rest/admin/lunchs.js on lines 13..18
rest/admin/overtimes.js on lines 7..13
rest/admin/overtimes.js on lines 17..23
rest/admin/overtimesummary.js on lines 4..10
rest/admin/personalevents.js on lines 6..12
rest/admin/recoverquantities.js on lines 7..13
rest/admin/recoverquantities.js on lines 17..23
rest/admin/rightrenewals.js on lines 7..13
rest/admin/rightrenewals.js on lines 17..23
rest/admin/rightrenewals.js on lines 43..49
rest/admin/rights.js on lines 6..12
rest/admin/rights.js on lines 16..22
rest/admin/rights.js on lines 42..48
rest/admin/specialrights.js on lines 6..12
rest/admin/timesavingaccounts.js on lines 6..12
rest/admin/types.js on lines 7..13
rest/admin/types.js on lines 17..23
rest/admin/types.js on lines 43..49
rest/admin/unavailableevents.js on lines 6..12
rest/admin/users.js on lines 4..9
rest/admin/users.js on lines 12..18
rest/admin/users.js on lines 38..44
rest/admin/usersstat.js on lines 6..12
rest/admin/waitingrequests.js on lines 7..13
rest/admin/waitingrequests.js on lines 17..23

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

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