appscot/sails-orientdb

View on GitHub

Showing 63 of 63 total issues

Function createEdge has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    createEdge : function(connection, collection, from, to, options, cb) {
Severity: Minor
Found in lib/adapter.js - About 45 mins to fix

    Function deleteEdges has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        deleteEdges : function(connection, collection, from, to, options, cb) {
    Severity: Minor
    Found in lib/adapter.js - About 45 mins to fix

      Function find has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Edge.prototype.find = function find(criteria, cb) {
        var self = this;
        var _query, query;
        
        try {
      Severity: Minor
      Found in lib/collection/edge.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function increment has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      Connection.prototype.increment = function(collection, criteria, field, amount, cb) {
      Severity: Minor
      Found in lib/connection.js - About 35 mins to fix

        Function reduceNestedObjects has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        exports.reduceNestedObjects = function reduceNestedObjects(collection, 
                                                                   callback,
                                                                   accumulator,
                                                                   rootKey,
                                                                   processedObjects) {
        Severity: Minor
        Found in lib/utils.js - About 35 mins to fix

          Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              update : function(connection, collection, options, values, cb) {
          Severity: Minor
          Found in lib/adapter.js - About 35 mins to fix

            Function query has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                query : function(connection, collection, query, options, cb) {
            Severity: Minor
            Found in lib/adapter.js - About 35 mins to fix

              Function addAttribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  addAttribute: function(connection, collection, attrName, attrDef, cb) {
              Severity: Minor
              Found in lib/adapter.js - About 35 mins to fix

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

                Connection.prototype.create = function(collection, options, cb) {
                  this.collections[collection].insert(options, cb);
                };
                Severity: Minor
                Found in lib/connection.js and 2 other locations - About 35 mins to fix
                lib/connection.js on lines 343..345
                lib/connection.js on lines 388..390

                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

                Connection.prototype.destroy = function(collection, options, cb) {
                  this.collections[collection].destroy(options, cb);
                };
                Severity: Minor
                Found in lib/connection.js and 2 other locations - About 35 mins to fix
                lib/connection.js on lines 343..345
                lib/connection.js on lines 372..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 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

                Connection.prototype.find = function(collection, options, cb) {
                  this.collections[collection].find(options, cb);
                };
                Severity: Minor
                Found in lib/connection.js and 2 other locations - About 35 mins to fix
                lib/connection.js on lines 372..374
                lib/connection.js on lines 388..390

                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

                Function decode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                Query.prototype.decode = function decode(idValue) {
                  var self = this;
                  
                  if(! idValue || !self.decodeURIComponent) { return idValue; }
                  
                Severity: Minor
                Found in lib/query.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getVerticesFromEdges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                Associations.prototype.getVerticesFromEdges = function getVerticesFromEdges(edges, side) {
                  if(!_.isArray(edges)){
                    if(_.isString(edges)) { return []; }  // only carries ID of edge
                    var vertex = _.isString(edges[side]) ? { id: edges[side] } : edges[side];
                    return [ vertex ];
                Severity: Minor
                Found in lib/associations.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function normalizeId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                Record.prototype.normalizeId = function normalizeId(values) {
                  
                  if(!values.hasOwnProperty('id') && !values.hasOwnProperty('@rid')) return;
                  
                  var id = values.id || values['@rid'];
                Severity: Minor
                Found in lib/record.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function rewriteIdsRecursive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.rewriteIdsRecursive = function rewriteIdsRecursive(models, schema, accumulator) {
                  var self = this;
                  var isModelsArray = _.isArray(models);
                  var modelsAux = isModelsArray ? models : [models];
                  accumulator = accumulator || {};
                Severity: Minor
                Found in lib/utils.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                      if(targetCollection.primaryKey === 'id'){
                        log.warn('Nullifying foreign key [' + key + '] (value: [' + values[key] +
                          ']) as value is not a RID and Waterline does not expect an error.');
                        values[key] = null;
                      }
                Severity: Minor
                Found in lib/record.js and 1 other location - About 35 mins to fix
                lib/record.js on lines 153..174

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

                    else if(foreignKey) {
                      log.warn('Nullifying foreign key [' + key + '] (value: [' + values[key] +
                        ']) as value is not a RID and Waterline does not expect an error.');
                      values[key] = null;
                    }
                Severity: Minor
                Found in lib/record.js and 1 other location - About 35 mins to fix
                lib/record.js on lines 147..151

                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

                Avoid too many return statements within this function.
                Open

                  return idValue;
                Severity: Major
                Found in lib/query.js - About 30 mins to fix

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

                  var Pet = Waterline.Collection.extend({
                  
                    identity: 'pet',
                    connection: 'myLocalOrient',
                  
                  
                  Severity: Minor
                  Found in example/express/express-example.js and 1 other location - About 30 mins to fix
                  example/express/express-example.js on lines 70..79

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

                  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

                  var User = Waterline.Collection.extend({
                  
                    identity: 'user',
                    connection: 'myLocalOrient',
                  
                  
                  Severity: Minor
                  Found in example/express/express-example.js and 1 other location - About 30 mins to fix
                  example/express/express-example.js on lines 81..90

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 45.

                  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