Showing 22 of 35 total issues
Function readInet
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
DataStream.prototype.readInet = function() {
var i;
if (this.data.length === 4) {
// IPv4
var inet = [];
- 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 _executeJoin
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Get.prototype._executeJoin = function(rows, join) {
var self = this;
var defer = Q.defer();
var columns = {};
var values = {};
Function next
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
var next = function() {
if (!rows.valid()) {
rows.rewind();
defer.resolve({columns: columns, values: values});
return;
Function execute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Get.prototype.execute = function() {
var self = this;
return Q.when(this._schema).then(function(schema) {
if (typeof schema === 'undefined') {
throw Error('Unknown table ' + self._table);
Function translateType
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Schema.prototype.translateType = function(validator) {
validator = validator.split('org.apache.cassandra.db.marshal.').join('');
var baseType = validator.split('(')[0];
var types = {
'AsciiType': TypeSpec.ASCII,
Function connect
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Transport.prototype.connect = function() {
var self = this;
if (new Date() - this._lastConnectAttempt < 5000) {
return;
Function Rows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Rows = function(data) {
this.columns = [];
this.rowCount = 0;
this.columnCount = 0;
this._current = 0;
Function getValueString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Field.prototype.getValueString = function() {
if (this.value === null) {
// All field types can be null.
return 'NULL';
}
Function readByType
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
DataStream.prototype.readByType = function(type) {
switch (type.getType()) {
case TypeSpec.ASCII:
case TypeSpec.VARCHAR:
case TypeSpec.TEXT:
Function execute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Query.prototype.execute = function() {
var self = this;
var defer = Q.defer();
var length = Buffer.byteLength(this._cql, 'utf8');
Function execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Set.prototype.execute = function() {
var self = this;
return Q.when(this._schema).then(function(schema) {
self._update.forEach(function(update) {
if (typeof schema.columns[update.field] === 'undefined') {
Function _fetchFrames
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Transport.prototype._fetchFrames = function() {
// We need at least 8 bytes for the frame header.
while (this._inputBuffer.length >= 8) {
var length = 8 + this._inputBuffer.readUInt32BE(4);
if (this._inputBuffer.length < length) {
Function readInet
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
DataStream.prototype.readInet = function() {
var i;
if (this.data.length === 4) {
// IPv4
var inet = [];
Function read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Schema.prototype.read = function() {
var self = this;
var cql = 'SELECT columnfamily_name, column_name, type, validator FROM system.schema_columns WHERE keyspace_name = \'' + this._keyspace + '\'';
var query = new Query(this._transport, cql, this._consistency);
this._schema = query.then(function(rows) {
- 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 _fetchFrames
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Transport.prototype._fetchFrames = function() {
// We need at least 8 bytes for the frame header.
while (this._inputBuffer.length >= 8) {
var length = 8 + this._inputBuffer.readUInt32BE(4);
if (this._inputBuffer.length < length) {
- 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 Rows
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var Rows = function(data) {
this.columns = [];
this.rowCount = 0;
this.columnCount = 0;
this._current = 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 lt
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Bignum.prototype.lt = function(num) {
var a = this._num.toString();
var b = num.toString();
if (a == b) {
return false;
- 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 current
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Rows.prototype.current = function() {
if (typeof this.rows[this._current] === 'undefined') {
throw Error('Invalid position');
}
var row = this.rows[this._current];
- 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 getTimestamp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Field.prototype.getTimestamp = function() {
if (typeof this.value === 'string') {
var isDate = this.value.match(/^[0-9]{4}\-[012][0-9]\-[0-3][0-9]$/);
var isDateTime = this.value.match(/^[0-9]{4}\-[012][0-9]\-[0-3][0-9]T[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9](\.[0-9]+)?(Z|[\+\-][012][0-9]\:[0-5][0-9])?$/);
if (!isDate && !isDateTime) {
- 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 _executeJoin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Get.prototype._executeJoin = function(rows, join) {
var self = this;
var defer = Q.defer();
var columns = {};
var values = {};
- 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"