balderdashy/waterline

View on GitHub

Showing 357 of 357 total issues

Function count has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function count( /* criteria?, explicitCbMaybe?, meta?, moreQueryKeys? */ ) {

  // Verify `this` refers to an actual Sails/Waterline model.
  verifyModelMethodContext(this);

Severity: Major
Found in lib/waterline/methods/count.js - About 2 hrs to fix

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

      sum: function() {
    
        if (!this._alreadyInitiallyExpandedCriteria) {
          this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
          this._alreadyInitiallyExpandedCriteria = true;
    Severity: Major
    Found in lib/waterline/utils/query/get-query-modifier-methods.js and 4 other locations - About 2 hrs to fix
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 623..633
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 644..654
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 664..674
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 682..692

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

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

      groupBy: function() {
    
        if (!this._alreadyInitiallyExpandedCriteria) {
          this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
          this._alreadyInitiallyExpandedCriteria = true;
    Severity: Major
    Found in lib/waterline/utils/query/get-query-modifier-methods.js and 4 other locations - About 2 hrs to fix
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 603..613
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 623..633
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 644..654
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 664..674

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

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

      avg: function() {
    
        if (!this._alreadyInitiallyExpandedCriteria) {
          this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
          this._alreadyInitiallyExpandedCriteria = true;
    Severity: Major
    Found in lib/waterline/utils/query/get-query-modifier-methods.js and 4 other locations - About 2 hrs to fix
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 603..613
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 644..654
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 664..674
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 682..692

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

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

              if (_.has(Object.getPrototypeOf(WLChild), 'junctionTable') && WLChild.junctionTable) {
                // Assumes the generated junction table will only ever have two foreign key
                // values. Should be safe for now and any changes would need to be made in
                // Waterline-Schema where a map could be formed anyway.
                _.each(WLChild.schema, function(wlsAttrDef, key) {
    Severity: Major
    Found in lib/waterline/methods/add-to-collection.js and 1 other location - About 2 hrs to fix
    lib/waterline/methods/replace-collection.js on lines 371..385

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

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

      max: function() {
    
        if (!this._alreadyInitiallyExpandedCriteria) {
          this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
          this._alreadyInitiallyExpandedCriteria = true;
    Severity: Major
    Found in lib/waterline/utils/query/get-query-modifier-methods.js and 4 other locations - About 2 hrs to fix
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 603..613
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 623..633
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 644..654
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 682..692

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

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

              if (_.has(Object.getPrototypeOf(WLChild), 'junctionTable') && WLChild.junctionTable) {
                // Assumes the generated junction table will only ever have two foreign key
                // values. Should be safe for now and any changes would need to be made in
                // Waterline-Schema where a map could be formed anyway.
                _.each(WLChild.schema, function(wlsAttrDef, key) {
    Severity: Major
    Found in lib/waterline/methods/replace-collection.js and 1 other location - About 2 hrs to fix
    lib/waterline/methods/add-to-collection.js on lines 360..374

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

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

      min: function() {
    
        if (!this._alreadyInitiallyExpandedCriteria) {
          this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
          this._alreadyInitiallyExpandedCriteria = true;
    Severity: Major
    Found in lib/waterline/utils/query/get-query-modifier-methods.js and 4 other locations - About 2 hrs to fix
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 603..613
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 623..633
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 664..674
    lib/waterline/utils/query/get-query-modifier-methods.js on lines 682..692

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

    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

    Function getAttribute has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function getAttribute(attrName, modelIdentity, orm) {
    
      // ================================================================================================
      // Check that the provided `attrName` is valid.
      // (`modelIdentity` and `orm` will be automatically checked by calling `getModel()`)
    Severity: Major
    Found in lib/waterline/utils/ontology/get-attribute.js - About 2 hrs to fix

      Function destroyOne has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function destroyOne(criteria, explicitCbMaybe, metaContainer){
      
        // Verify `this` refers to an actual Sails/Waterline model.
        verifyModelMethodContext(this);
      
      
      Severity: Major
      Found in lib/waterline/methods/destroy-one.js - About 2 hrs to fix

        Function whenWaterlineIsReady has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          }, function whenWaterlineIsReady (err, orm) {
            if (err) {
              return done(new Error('Could not start up Waterline ORM: '+err.stack));
            }//--•
        
        
        Severity: Major
        Found in example/raw/raw-example.js - About 2 hrs to fix

          Function archiveOne has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function archiveOne(criteria, explicitCbMaybe, metaContainer){
          
            // Verify `this` refers to an actual Sails/Waterline model.
            verifyModelMethodContext(this);
          
          
          Severity: Major
          Found in lib/waterline/methods/archive-one.js - About 2 hrs to fix

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

                      _.each(query.targetRecordIds, function(targetId) {
                        _.each(query.associatedIds, function(associatedId) {
                          var record = {};
                          record[parentReference] = targetId;
                          record[childReference] = associatedId;
            Severity: Major
            Found in lib/waterline/methods/replace-collection.js and 1 other location - About 2 hrs to fix
            lib/waterline/methods/add-to-collection.js on lines 411..418

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

            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

                      _.each(query.targetRecordIds, function(targetId) {
                        _.each(query.associatedIds, function(associatedId) {
                          var record = {};
                          record[parentReference] = targetId;
                          record[childReference] = associatedId;
            Severity: Major
            Found in lib/waterline/methods/add-to-collection.js and 1 other location - About 2 hrs to fix
            lib/waterline/methods/replace-collection.js on lines 413..420

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

            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

            Function _afterTalkingToAdapter has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    adapter.update(WLModel.datastore, query, function _afterTalkingToAdapter(err, rawAdapterResult) {
                      if (err) {
                        err = forgeAdapterError(err, omen, 'update', modelIdentity, orm);
                        return done(err);
                      }//-•
            Severity: Major
            Found in lib/waterline/methods/update.js - About 2 hrs to fix

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

                skip: function(skip) {
              
                  if (!this._alreadyInitiallyExpandedCriteria) {
                    this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
                    this._alreadyInitiallyExpandedCriteria = true;
              Severity: Major
              Found in lib/waterline/utils/query/get-query-modifier-methods.js and 5 other locations - About 2 hrs to fix
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 274..284
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 432..442
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 457..467
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 475..485
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 501..511

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

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

                limit: function(limit) {
              
                  if (!this._alreadyInitiallyExpandedCriteria) {
                    this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
                    this._alreadyInitiallyExpandedCriteria = true;
              Severity: Major
              Found in lib/waterline/utils/query/get-query-modifier-methods.js and 5 other locations - About 2 hrs to fix
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 293..303
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 432..442
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 457..467
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 475..485
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 501..511

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

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

                select: function(selectAttributes) {
              
                  if (!this._alreadyInitiallyExpandedCriteria) {
                    this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
                    this._alreadyInitiallyExpandedCriteria = true;
              Severity: Major
              Found in lib/waterline/utils/query/get-query-modifier-methods.js and 5 other locations - About 2 hrs to fix
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 274..284
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 293..303
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 432..442
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 475..485
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 501..511

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

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

                sort: function(sortClause) {
              
                  if (!this._alreadyInitiallyExpandedCriteria) {
                    this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
                    this._alreadyInitiallyExpandedCriteria = true;
              Severity: Major
              Found in lib/waterline/utils/query/get-query-modifier-methods.js and 5 other locations - About 2 hrs to fix
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 274..284
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 293..303
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 457..467
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 475..485
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 501..511

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

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

                omit: function(omitAttributes) {
              
                  if (!this._alreadyInitiallyExpandedCriteria) {
                    this._wlQueryInfo.criteria = expandWhereShorthand(this._wlQueryInfo.criteria);
                    this._alreadyInitiallyExpandedCriteria = true;
              Severity: Major
              Found in lib/waterline/utils/query/get-query-modifier-methods.js and 5 other locations - About 2 hrs to fix
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 274..284
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 293..303
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 432..442
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 457..467
              lib/waterline/utils/query/get-query-modifier-methods.js on lines 501..511

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

              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