Showing 105 of 189 total issues
File types.js
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var Builder = require('buffer-builder'),
Int64 = require('node-int64'),
errors = require('./errors'),
AMQPArray = require('./types/amqp_composites').Array,
Function Connection
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Connection(connectPolicy) {
Connection.super_.call(this);
var options = connectPolicy.options;
u.assertArguments(options, ['containerId', 'hostname']);
File session.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var EventEmitter = require('events').EventEmitter,
util = require('util'),
File connection.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var EventEmitter = require('events').EventEmitter,
fs = require('fs'),
util = require('util'),
File amqp_client.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var EventEmitter = require('events').EventEmitter,
Promise = require('bluebird'),
debug = require('debug')('amqp10:client'),
util = require('util'),
Function wrapField
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function wrapField(field, value) {
if (value instanceof ForcedType) return value;
if (value === undefined || value === null) {
if (field.mandatory) throw new Error('missing mandatory field: ' + field.name);
if (field.hasOwnProperty('default')) return wrapField(field, field.default);
- 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 connect
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
AMQPClient.prototype.connect = function(url, policyOverrides) {
var self = this;
policyOverrides = policyOverrides || {};
var connectPolicy = u.deepMerge(policyOverrides, self.policy.connect);
return new Promise(function(resolve, reject) {
Function x
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function x(hexstr, consumed, result, indent) {
if (hexstr.length === 0) return { consumed: consumed, result: result };
var prefix = hexstr.substr(0, 2);
hexstr = hexstr.substr(2);
Function deepMerge
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function deepMerge() {
var args = Array.prototype.slice.call(arguments);
var helper = function(tgt, src, key) {
var s2, t2;
if (key === undefined) {
- 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 defineComposite
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function defineComposite(Base, definition) {
if (definition === undefined) {
definition = Base;
Base = Object;
}
- 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 arrayBuilder
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function arrayBuilder(val, bufb, codec, width) {
if (!(val instanceof AMQPArray)) {
throw new errors.EncodingError(val, 'Unsure how to encode non-amqp array as array');
}
- 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 send
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
SenderLink.prototype.send = function(msg, options) {
options = options || {};
var noReply = false;
if (options.hasOwnProperty('noReply')) {
- 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 mapBuilderForKeyType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function mapBuilderForKeyType(keyType) {
return function mapBuilder(map, bufb, codec, width) {
if (typeof map !== 'object') {
throw new errors.EncodingError(map, 'Unsure how to encode non-object as map');
}
- 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 frames.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var Builder = require('buffer-builder'),
DescribedType = require('./types/described_type'),
errors = require('./errors'),
codec = require('./codec'),
Function send
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
SenderLink.prototype.send = function(msg, options) {
options = options || {};
var noReply = false;
if (options.hasOwnProperty('noReply')) {
Function Policy
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Policy(overrides) {
if (!(this instanceof Policy))
return new Policy(overrides);
u.defaults(this, overrides, {
Function _encodeObject
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Codec.prototype._encodeObject = function(value, buffer) {
if (value instanceof DescribedType) {
buffer.appendUInt8(0x00);
// NOTE: Described type constructors are either ulongs or a symbol. Here
- 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 encodeMessage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports.encodeMessage = function(message, buffer) {
var _keys = Object.keys(sectionByProperty), _len = _keys.length;
for (var i = 0; i < _len; ++i) {
var property = _keys[i], definition = sectionByProperty[property];
if (message.hasOwnProperty(property)) {
- 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 _receiveAny
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Connection.prototype._receiveAny = function() {
var frame = null;
while (true) {
if (this.sasl && !this.sasl.receivedHeader) {
if (!this._tryReceiveHeader(constants.saslVersion)) break;
- 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 x
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function x(hexstr, consumed, result, indent) {
if (hexstr.length === 0) return { consumed: consumed, result: result };
var prefix = hexstr.substr(0, 2);
hexstr = hexstr.substr(2);
- 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"