mbroadst/rethunk

View on GitHub

Showing 144 of 396 total issues

Consider simplifying this complex logical expression.
Open

      if ((key !== 'shards') && (key !== 'replicas') &&
        (key !== 'dryRun') && (key !== 'primaryReplicaTag') &&
        (key !== 'nonvotingReplicaTags') && (key !== 'emergencyRepair')) {
        throw new errors.ReqlDriverError('Unrecognized option `'+key+'` in `reconfigure`', self._query, 'Available options are shards: <number>, replicas: <number>, primaryReplicaTag: <object>, dryRun <boolean>, emergencyRepair: <string>, nonvotingReplicaTags: <array<string>>');
      }
Severity: Major
Found in lib/term.js - About 40 mins to fix

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

      TABLE: function(term, index, father, frames, options) {
    Severity: Minor
    Found in lib/error.js - About 35 mins to fix

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

      function generateNormalBacktrace(term, index, father, frames, options) {
      Severity: Minor
      Found in lib/error.js - About 35 mins to fix

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

        Term.prototype._arityRange = function(args, min, max, method, term) {
        Severity: Minor
        Found in lib/term.js - About 35 mins to fix

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

            GET_FIELD: function(term, index, father, frames, options) {
          Severity: Minor
          Found in lib/error.js - About 35 mins to fix

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

              IMPLICIT_VAR: function(term, index, father, frames, options) {
            Severity: Minor
            Found in lib/error.js - About 35 mins to fix

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

                MAP: function(term, index, father, frames, options) {
              Severity: Minor
              Found in lib/error.js - About 35 mins to fix

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

                  WAIT: function(term, index, father, frames, options) {
                Severity: Minor
                Found in lib/error.js - About 35 mins to fix

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

                  function generateWithoutPrefixBacktrace(term, index, father, frames, options) {
                  Severity: Minor
                  Found in lib/error.js - About 35 mins to fix

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

                      FUNC: function(term, index, father, frames, options) {
                    Severity: Minor
                    Found in lib/error.js - About 35 mins to fix

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

                      function generateBacktrace(term, index, father, frames, options) {
                      Severity: Minor
                      Found in lib/error.js - About 35 mins to fix

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

                          VAR: function(term, index, father, frames, options) {
                        Severity: Minor
                        Found in lib/error.js - About 35 mins to fix

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

                            MAKE_ARRAY: function(term, index, father, frames, options) {
                          Severity: Minor
                          Found in lib/error.js - About 35 mins to fix

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

                              FUNCALL: function(term, index, father, frames, options) {
                            Severity: Minor
                            Found in lib/error.js - About 35 mins to fix

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

                              Term.prototype.random = function() {
                                var _len = arguments.length; var _args = new Array(_len);
                                for (var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];}
                                var self = this;
                                self._noPrefix(this, 'random');
                              Severity: Minor
                              Found in lib/term.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 _flush has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Cursor.prototype._flush = function() {
                                while ((this._pendingPromises.length > 0) && ((this._data.length > 0) || ((this._fetching === false) && (this._canFetch === false)))) {
                                  var fullfiller = this._pendingPromises.shift();
                                  var resolve = fullfiller.resolve;
                                  var reject = fullfiller.reject;
                              Severity: Minor
                              Found in lib/cursor.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 generateBacktrace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function generateBacktrace(term, index, father, frames, options) {
                                var result = { str: '', car: '' };
                                var backtrace, underline;
                              
                                // frames = null -> do not underline
                              Severity: Minor
                              Found in lib/error.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 indexCreate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Term.prototype.indexCreate = function(name, fn, options) {
                                if (this._fastArityRange(arguments.length, 1, 3) === false) {
                                  var _len = arguments.length; var _args = new Array(_len);
                                  for (var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];}
                                  this._arityRange(_args, 1, 3, 'indexCreate', this);
                              Severity: Minor
                              Found in lib/term.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 union has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Term.prototype.union = function() {
                                var _len = arguments.length;var _args = new Array(_len); for(var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];}
                              
                                var term = new Term(this._r);
                                term._query.push(termTypes.UNION);
                              Severity: Minor
                              Found in lib/term.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 Term has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function Term(r, value, error) {
                                var self = this;
                                var term = function(field) {
                                  if (Term.prototype._fastArity(arguments.length, 1) === false) {
                                    var _len = arguments.length; var _args = new Array(_len);
                              Severity: Minor
                              Found in lib/term.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

                              Severity
                              Category
                              Status
                              Source
                              Language