FOGProject/fog-too

View on GitHub

Showing 83 of 169 total issues

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

    prodStylesRelativeJade: {
      options: {
        startTag: '// STYLES',
        endTag: '// STYLES END',
        fileTmpl: 'link(rel="stylesheet", href="%s")',
Severity: Minor
Found in tasks/config/sails-linker.js and 1 other location - About 45 mins to fix
tasks/config/sails-linker.js on lines 203..214

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.group.read"))
    return next();
  res.forbidden("Group read permission required");
};
Severity: Major
Found in api/policies/groupRead.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.workflow.create"))
    return next();
  res.forbidden("Workflow create permission required");
};
Severity: Major
Found in api/policies/workflowCreate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.host.create"))
    return next();
  res.forbidden("Host create permission required");
};
Severity: Major
Found in api/policies/hostCreate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.image.update"))
    return next();
  res.forbidden("Image update permission required");
};
Severity: Major
Found in api/policies/imageUpdate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.role.update"))
    return next();
  res.forbidden("Role update permission required");
};
Severity: Major
Found in api/policies/roleUpdate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.image.deploy"))
    return next();
  res.forbidden("Image destroy permission required");
};
Severity: Major
Found in api/policies/imageDeploy.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.image.capture"))
    return next();
  res.forbidden("Image capture permission required");
};
Severity: Major
Found in api/policies/imageCapture.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.image.create"))
    return next();
  res.forbidden("Image create permission required");
};
Severity: Major
Found in api/policies/imageCreate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.group.register"))
    return next();
  res.forbidden("Group register permission required");
};
Severity: Major
Found in api/policies/groupRegister.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.role.assign"))
    return next();
  res.forbidden("Role assign permission required");
};
Severity: Major
Found in api/policies/roleAssign.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.workflow.read"))
    return next();
  res.forbidden("Workflow read permission required");
};
Severity: Major
Found in api/policies/workflowRead.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.group.update"))
    return next();
  res.forbidden("Group update permission required");
};
Severity: Major
Found in api/policies/groupUpdate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.user.create"))
    return next();
  res.forbidden("User create permission required");
};
Severity: Major
Found in api/policies/userCreate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.role.read"))
    return next();
  res.forbidden("Role read permission required");
};
Severity: Major
Found in api/policies/roleRead.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.host.read"))
    return next();
  res.forbidden("Host read permission required");
};
Severity: Major
Found in api/policies/hostRead.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.host.update"))
    return next();
  res.forbidden("Host update permission required");
};
Severity: Major
Found in api/policies/hostUpdate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.user.update"))
    return next();
  res.forbidden("User update permission required");
};
Severity: Major
Found in api/policies/userUpdate.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.user.destroy"))
    return next();
  res.forbidden("User destroy permission required");
};
Severity: Major
Found in api/policies/userDestroy.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageDestroy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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

module.exports = function(req, res, next) {
  if(_.get(req, "user.permissions.stock.image.destroy"))
    return next();
  res.forbidden("Image destroy permission required");
};
Severity: Major
Found in api/policies/imageDestroy.js and 28 other locations - About 40 mins to fix
api/policies/groupCreate.js on lines 1..5
api/policies/groupDestroy.js on lines 1..5
api/policies/groupRead.js on lines 1..5
api/policies/groupRegister.js on lines 1..5
api/policies/groupUnregister.js on lines 1..5
api/policies/groupUpdate.js on lines 1..5
api/policies/hostCreate.js on lines 1..5
api/policies/hostDestroy.js on lines 1..5
api/policies/hostRead.js on lines 1..5
api/policies/hostUpdate.js on lines 1..5
api/policies/imageCapture.js on lines 1..5
api/policies/imageCreate.js on lines 1..5
api/policies/imageDeploy.js on lines 1..5
api/policies/imageRead.js on lines 1..5
api/policies/imageUpdate.js on lines 1..5
api/policies/roleAssign.js on lines 1..5
api/policies/roleCreate.js on lines 1..5
api/policies/roleDestroy.js on lines 1..5
api/policies/roleRead.js on lines 1..5
api/policies/roleUpdate.js on lines 1..5
api/policies/userCreate.js on lines 1..5
api/policies/userDestroy.js on lines 1..5
api/policies/userRead.js on lines 1..5
api/policies/userUpdate.js on lines 1..5
api/policies/workflowCreate.js on lines 1..5
api/policies/workflowDestroy.js on lines 1..5
api/policies/workflowRead.js on lines 1..5
api/policies/workflowUpdate.js on lines 1..5

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

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