balderdashy/waterline

View on GitHub

Showing 201 of 357 total issues

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

  if (!_.isArray(records)) {
    throw new Error('Consistency violation: Expected `records` to be an array.  But instead, got: '+util.inspect(records,{depth:5})+'');
  }
Severity: Minor
Found in lib/waterline/utils/query/process-all-records.js and 1 other location - About 40 mins to fix
lib/waterline/utils/query/private/build-usage-error.js on lines 159..161

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

  if (!_.isString(modelIdentity)) {
    throw new Error('Consistency violation: `modelIdentity` must be provided as a string, but instead, got: '+util.inspect(code, {depth:5})+'');
  }
Severity: Minor
Found in lib/waterline/utils/query/private/build-usage-error.js and 1 other location - About 40 mins to fix
lib/waterline/utils/query/private/normalize-constraint.js on lines 102..104

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

          throw flaverr({
            code: 'E_VIOLATES_RULES',
            attrName: supposedAttrName,
            ruleViolations: e.ruleViolations
          }, new Error(
Severity: Minor
Found in lib/waterline/utils/query/private/normalize-new-record.js and 1 other location - About 40 mins to fix
lib/waterline/utils/query/private/normalize-new-record.js on lines 196..202

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

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

          throw flaverr({
            code: 'E_TYPE',
            attrName: supposedAttrName,
            expectedType: e.expectedType
          }, new Error(
Severity: Minor
Found in lib/waterline/utils/query/private/normalize-new-record.js and 1 other location - About 40 mins to fix
lib/waterline/utils/query/private/normalize-new-record.js on lines 217..223

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(attrName)) {
    throw new Error('Consistency violation: Must specify `attrName` as a string.  But instead, got: '+util.inspect(attrName, {depth:5})+'');
  }
Severity: Major
Found in lib/waterline/utils/ontology/is-exclusive.js and 8 other locations - About 35 mins to fix
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(modelIdentity)) {
    throw new Error('Consistency violation: Must specify `modelIdentity` as a string.  But instead, got: '+util.inspect(modelIdentity, {depth:5})+'');
  }
Severity: Major
Found in lib/waterline/utils/ontology/is-exclusive.js and 8 other locations - About 35 mins to fix
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        WLModel._callbacks.beforeDestroy(query.criteria, function (err){
          if (err) { return proceed(err); }
          return proceed(undefined, query);
        });
Severity: Minor
Found in lib/waterline/methods/destroy.js and 2 other locations - About 35 mins to fix
lib/waterline/methods/create.js on lines 190..193
lib/waterline/methods/update.js on lines 222..225

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(modelIdentity)) { throw new Error('Consistency violation: This internal utility must always be called with a valid third argument (the model identity).  But instead, got: '+util.inspect(modelIdentity, {depth:5})+''); }
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(details)) {
    throw new Error('Consistency violation: `details` must be provided as a string, but instead got: '+util.inspect(details, {depth:5})+'');
  }
Severity: Major
Found in lib/waterline/utils/query/private/build-usage-error.js and 8 other locations - About 35 mins to fix
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(attrName)) { throw new Error('Consistency violation: This internal utility must always be called with a valid second argument (the attribute name).  But instead, got: '+util.inspect(attrName, {depth:5})+''); }
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(modelIdentity)) {
    throw new Error('Consistency violation: Must specify `modelIdentity` as a string.  But instead, got: '+util.inspect(modelIdentity, {depth:5})+'');
  }
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isObject(orm)) { throw new Error('Consistency violation: This internal utility must always be called with a valid fourth argument (the orm instance).  But instead, got: '+util.inspect(orm, {depth:5})+''); }
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(attrName)) {
    throw new Error('Consistency violation: Must specify `attrName` as a string.  But instead, got: '+util.inspect(attrName, {depth:5})+'');
  }
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57
lib/waterline/utils/query/private/normalize-constraint.js on lines 99..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        WLModel._callbacks.beforeUpdate(query.valuesToSet, function(err){
          if (err) { return proceed(err); }
          return proceed(undefined, query);
        });
Severity: Minor
Found in lib/waterline/methods/update.js and 2 other locations - About 35 mins to fix
lib/waterline/methods/create.js on lines 190..193
lib/waterline/methods/destroy.js on lines 216..219

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  if (!_.isString(constraintTarget)) {
    throw new Error('Consistency violation: The internal normalizeConstraint() utility must always be called with a valid second argument (a string).  But instead, got: '+util.inspect(constraintTarget, {depth:5})+'');
  }
Severity: Major
Found in lib/waterline/utils/query/private/normalize-constraint.js and 8 other locations - About 35 mins to fix
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 32..34
lib/waterline/utils/ontology/is-capable-of-optimized-populate.js on lines 35..37
lib/waterline/utils/ontology/is-exclusive.js on lines 34..36
lib/waterline/utils/ontology/is-exclusive.js on lines 37..39
lib/waterline/utils/query/private/build-usage-error.js on lines 162..164
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 55..55
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 56..56
lib/waterline/utils/query/private/normalize-comparison-value.js on lines 57..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        WLModel._callbacks.beforeCreate(query.newRecord, function(err){
          if (err) { return proceed(err); }
          return proceed(undefined, query);
        });
Severity: Minor
Found in lib/waterline/methods/create.js and 2 other locations - About 35 mins to fix
lib/waterline/methods/destroy.js on lines 216..219
lib/waterline/methods/update.js on lines 222..225

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      else if (sortDirection === -1) {
        newComparatorDirective[sortByKey] = 'DESC';
      }
      else {
        throw flaverr('E_SORT_CLAUSE_UNUSABLE', new Error(
Severity: Minor
Found in lib/waterline/utils/query/private/normalize-sort-clause.js and 1 other location - About 35 mins to fix
lib/waterline/utils/query/private/normalize-sort-clause.js on lines 185..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      else if (pieces.length === 1) {
        // If there is only the attribute name specified, then assume that we're implying 'ASC'.
        // > For example, if we worked together at a pet shelter where there were two dogs (named
        // > "Suzy" and "Arnold") and a parrot named "Eleanor", and our boss asked us for a list of
        // > all the animals, sorted by name, we'd most likely assume that the list should begin witih
Severity: Minor
Found in lib/waterline/utils/query/private/normalize-sort-clause.js and 1 other location - About 35 mins to fix
lib/waterline/utils/query/private/normalize-sort-clause.js on lines 93..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    else if (WLModel.hasSchema === false) {

      // Make sure this is at least a valid name for a Waterline attribute.
      if (!isValidAttributeName(attrName)) {
        throw flaverr('E_SORT_CLAUSE_UNUSABLE', new Error(
Severity: Major
Found in lib/waterline/utils/query/private/normalize-sort-clause.js and 3 other locations - About 35 mins to fix
lib/waterline/utils/query/private/normalize-constraint.js on lines 173..184
lib/waterline/utils/query/private/normalize-criteria.js on lines 782..792
lib/waterline/utils/query/private/normalize-criteria.js on lines 893..909

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  else if (WLModel.hasSchema === false) {

    // Make sure this is at least a valid name for a Waterline attribute.
    if (!isValidAttributeName(attrName)) {
      throw flaverr('E_CONSTRAINT_NOT_USABLE', new Error(
Severity: Major
Found in lib/waterline/utils/query/private/normalize-constraint.js and 3 other locations - About 35 mins to fix
lib/waterline/utils/query/private/normalize-criteria.js on lines 782..792
lib/waterline/utils/query/private/normalize-criteria.js on lines 893..909
lib/waterline/utils/query/private/normalize-sort-clause.js on lines 335..347

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

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