Showing 144 of 396 total issues
File term.js
has 2755 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var Promise = require('bluebird');
var protodef = require('./protodef.js');
var termTypes = protodef.Term.TermType;
File error.js
has 823 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var helper = require('./helper.js'),
protodef = require('./protodef.js'),
protoErrorType = protodef.Response.ErrorType,
termTypes = protodef.Term.TermType,
File connection.js
has 582 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var net = require('net'),
tls = require('tls'),
Promise = require('bluebird'),
events = require('events'),
File index.js
has 519 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var Promise = require('bluebird');
var helper = require(__dirname + '/helper.js');
var Connection = require(__dirname + '/connection.js');
File pool_master.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var util = require('util');
var events = require('events');
var Promise = require('bluebird');
var Dequeue = require('double-ended-queue');
Function DATUM
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
DATUM: function(term, index, father, frames, options, optarg) {
optarg = optarg || false;
var underline = Array.isArray(frames) && (frames.length === 0);
var currentFrame, backtrace;
- 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 Connection
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Connection(r, options, resolve, reject) {
var self = this;
this.r = r;
this.state = 0; // Track the progress of the handshake. -1 will be used for an error state.
Function handleAllServersResponse
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
PoolMaster.prototype.handleAllServersResponse = function(servers) {
var self = this;
if (self._draining === true) return;
// Fill all the known server from RethinkDB
- 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
File cursor.js
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var Promise = require('bluebird'),
EventEmitter = require('events').EventEmitter,
errors = require('./error.js'),
helper = require('./helper.js');
Function hasImplicit
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function hasImplicit(arg) {
if (Array.isArray(arg)) {
if (arg[0] === termTypes.IMPLICIT_VAR) return true;
if (Array.isArray(arg[1])) {
- 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 fetchServers
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
PoolMaster.prototype.fetchServers = function(useSeeds) {
var self = this;
var query = self._r.db('rethinkdb').table('server_status')
.union([SEPARATOR])
.union(self._r.db('rethinkdb').table('server_status').changes());
File pool.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var Promise = require('bluebird');
var Dequeue = require('double-ended-queue');
var helper = require('./helper.js');
var errors = require('./error.js');
Function _next
has a Cognitive Complexity of 26 (exceeds 5 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) {
- 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
File discovery.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
var config = require(__dirname+'/../test/config.js');
var longConfig = require(__dirname+'/config.js');
var assert = require('assert');
var util = require(__dirname+'/../test/util/common.js');
Function expr
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Term.prototype.expr = function(expression, nestingLevel) {
var self = this;
self._noPrefix(self, 'expr');
if (self._fastArityRange(arguments.length, 1, 2) === false) {
var _len = arguments.length; var _args = new Array(_len);
- 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 createConnection
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Pool.prototype.createConnection = function() {
var self = this;
self._increaseNumConnections();
self._openingConnections++;
Function _arityRange
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Term.prototype._arityRange = function(args, min, max, method, term) {
var foundArgs = false, _len = args.length;
if (args.length < min) {
for (var i = 0; i < _len; ++i) {
if ((args[i] instanceof Term) && (args[i]._query[0] === termTypes.ARGS)) {
- 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 _next
has a Cognitive Complexity of 22 (exceeds 5 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) {
- 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
Consider simplifying this complex logical expression. Open
if ((key !== 'timeout')
&& (key !== 'attempts')
&& (key !== 'redirects')
&& (key !== 'verify')
&& (key !== 'resultFormat')
Function expr
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Term.prototype.expr = function(expression, nestingLevel) {
var self = this;
self._noPrefix(self, 'expr');
if (self._fastArityRange(arguments.length, 1, 2) === false) {
var _len = arguments.length; var _args = new Array(_len);