appscot/sails-orientdb

View on GitHub

Showing 43 of 63 total issues

Function _buildIndexes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Document.prototype._buildIndexes = function _buildIndexes() {
  var self = this;

  Object.keys(this.schema).forEach(function(key) {
    var columnName = self.schema[key].columnName ? self.schema[key].columnName : key;
Severity: Minor
Found in lib/collection/document.js - About 1 hr to fix

    Function waterlineReady has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    }, function waterlineReady (err, ontology){
      if (err) throw err;
      
      console.log('\nWaterline initialized\n');
      
    Severity: Minor
    Found in example/associations/many-to-many.js - About 1 hr to fix

      Function rewriteIds has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.rewriteIds = function rewriteIds(models, schema) {
        var self = this;
        var isModelsArray = _.isArray(models);
        var modelsAux = isModelsArray ? models : [models];
        
      Severity: Minor
      Found in lib/utils.js - About 1 hr to fix

        Function genericJoin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Associations.prototype.genericJoin = function genericJoin(collectionName, criteria, cb) {
          var self = this;
          
          // Ignore `select` from waterline core
          if ( typeof criteria === 'object') {
        Severity: Minor
        Found in lib/associations.js - About 1 hr to fix

          Function describe has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Connection.prototype.describe = function describe(collectionName, cb) {
            var self = this;
            
            if(self._collectionSync.itemsToProcess[collectionName]){
              delete self._collectionSync.itemsToProcess[collectionName];
          Severity: Minor
          Found in lib/connection.js - About 1 hr to fix

            Function cleanOrientAttributes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.cleanOrientAttributes = function cleanOrientAttributes(model, schema) {
              if (!model || !_.isObject(model))
                return;
              
              Object.keys(model).forEach(function(key) {
            Severity: Minor
            Found in lib/utils.js - About 55 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 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 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 increment has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    increment : function(connection, collection, criteria, field, amount, cb) {
                Severity: Minor
                Found in lib/adapter.js - About 45 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 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

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

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

                            Avoid too many return statements within this function.
                            Open

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