Showing 144 of 396 total issues
Function _each
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Cursor.prototype._each = function(callback, onFinish) {
if (this._closed === true) {
return callback(new errors.ReqlDriverError('You cannot retrieve data from a cursor that is closed'));
}
Function MAKE_ARRAY
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
MAKE_ARRAY: function(term, index, father, frames, options) {
var result = { str: '', car: '' };
var backtrace, underline, currentFrame;
underline = Array.isArray(frames) && (frames.length === 0);
- Read upRead up
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 getCanonicalAddress
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function getCanonicalAddress(addresses) {
// We suppose that the addresses are all valid, and therefore use loose regex
for (var i = 0; i < addresses.length; i++) {
var addresse = addresses[i];
if ((/^127(\.\d{1,3}){3}$/.test(addresse.host)) || (/0?:?0?:?0?:?0?:?0?:?0?:0?:1/.test(addresse.host))) {
- Read upRead up
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 orderBy
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Term.prototype.orderBy = function() {
var _len = arguments.length; var _args = new Array(_len);
for (var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];}
this._arityRange(_args, 1, Infinity, 'orderBy', this);
- Read upRead up
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 ReqlCompileError
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
error.ReqlCompileError = function(message, query, frames) {
error.ReqlBaseError.call(this, message);
this.name = 'ReqlCompileError';
if (!!query && !!frames) {
- Read upRead up
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 ReqlRuntimeError
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
error.ReqlRuntimeError = function(message, query, frames) {
error.ReqlBaseError.call(this, message);
this.name = 'ReqlRuntimeError';
if (!!query && !!frames) {
- Read upRead up
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 _eachAsyncInternal
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Cursor.prototype._eachAsyncInternal = function(callback, finalResolve, finalReject) {
if (this._closed === true) {
finalReject(new errors.ReqlDriverError('You cannot retrieve data from a cursor that is closed'));
return;
}
Function _handleSuccessPartial
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Connection.prototype._handleSuccessPartial = function(response, token) {
// We save the current resolve function because we are going to call cursor._fetch
// before resuming the user's yield
var currentResolve = this.metadata[token].resolve;
var currentReject = this.metadata[token].reject;
Function _next
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Cursor.prototype._next = function(callback) {
var self = this;
if (self._closed === true) {
return Promise.reject(new errors.ReqlDriverError('You cannot call `next` on a closed ' + self._type))
.nodeify(callback);
- Read upRead up
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 generateNormalBacktrace
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function generateNormalBacktrace(term, index, father, frames, options) {
var result = { str: '', car: '' };
var backtrace, currentFrame, underline;
underline = Array.isArray(frames) && (frames.length === 0);
currentFrame = Array.isArray(frames) ? frames.shift() : null;
- Read upRead up
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 generateNormalBacktrace
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateNormalBacktrace(term, index, father, frames, options) {
var result = { str: '', car: '' };
var backtrace, currentFrame, underline;
underline = Array.isArray(frames) && (frames.length === 0);
currentFrame = Array.isArray(frames) ? frames.shift() : null;
Function _next
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
TransformStream.prototype._next = function(value, encoding, done) {
var self = this;
if ((this._writableState.lastBufferedRequest !== null) && (this._writableState.lastBufferedRequest.chunk !== value)) {
// There's more data to buffer
if (this._cache.length < this._highWaterMark) {
Consider simplifying this complex logical expression. Open
} else if ((key !== 'timeFormat') && (key !== 'groupFormat') &&
(key !== 'binaryFormat') && (key !== 'cursor') &&
(key !== 'readable') && (key !== 'writable') &&
(key !== 'transform') && (key !== 'stream') &&
(key !== 'highWaterMark')) {
Function _next
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
WritableStream.prototype._next = function(value, encoding, done) {
var self = this;
if ((this._writableState.lastBufferedRequest !== null) && (this._writableState.lastBufferedRequest.chunk !== value)) {
// There's more data to buffer
if (this._cache.length < this._highWaterMark) {
Function generateWithoutPrefixBacktrace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function generateWithoutPrefixBacktrace(term, index, father, frames, options) {
var result = { str: '', car: '' };
var backtrace, currentFrame, underline;
underline = Array.isArray(frames) && (frames.length === 0);
- Read upRead up
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 nextCb
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var nextCb = function() {
self._stackSize++;
self._next().then(function(row) {
if (self._stackSize <= MAX_CALL_STACK) {
if (callback.length <= 1) {
Function run
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Term.prototype.run = function(connection, options, callback) {
if (!!this._error) {
return Promise.reject(new errors.ReqlRuntimeError(this._error, this._query, { b: this._frames }));
}
Function FUNCALL
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
FUNCALL: function(term, index, father, frames, options) {
// The syntax is args[1].do(args[0])
var result = { str: '', car: '' };
var backtrace, underline, currentFrame;
underline = Array.isArray(frames) && (frames.length === 0);
Function FUNC
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
FUNC: function(term, index, father, frames, options) {
var result = { str: '', car: '' };
var backtrace, underline, currentFrame;
underline = Array.isArray(frames) && (frames.length === 0);
Function getCanonicalAddress
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCanonicalAddress(addresses) {
// We suppose that the addresses are all valid, and therefore use loose regex
for (var i = 0; i < addresses.length; i++) {
var addresse = addresses[i];
if ((/^127(\.\d{1,3}){3}$/.test(addresse.host)) || (/0?:?0?:?0?:?0?:?0?:?0?:0?:1/.test(addresse.host))) {