Showing 105 of 189 total issues
Function _receiveAny
has 26 lines of code (exceeds 25 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;
Function parseHex
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function parseHex(hexstr) {
var amqpstr = constants.amqpVersion.toString('hex');
var headerIdx = hexstr.indexOf(amqpstr);
var body = hexstr;
if (headerIdx === -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 _processOpenFrame
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Connection.prototype._processOpenFrame = function(frame) {
this.connSM.openReceived();
if (this.connSM.getMachineState() === 'OPEN_RCVD') {
this.connSM.sendOpen();
}
- 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 _messageReceived
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ReceiverLink.prototype._messageReceived = function(transferFrame) {
if (transferFrame.aborted) {
this._currentTransferFrame = null;
debug('Message transfer aborted.');
return;
- 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 _dispositionReceived
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
SenderLink.prototype._dispositionReceived = function(details) {
if (!details.settled) {
return;
}
- 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 encode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Codec.prototype.encode = function(value, buffer, forceType) {
// Special-case null values
if (value === null) {
return types.null.encode(value, buffer);
}
- 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 RefreshSettled
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
RefreshSettled: function (threshold) {
return function (link, options) {
if (link.policy.rcvSettleMode === constants.receiverSettleMode.autoSettle) {
throw new errors.InvalidStateError('Cannot specify RefreshSettled as link refresh policy when auto-settling messages.');
}
- 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 bufferEqualsLegacy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function bufferEqualsLegacy(lhs, rhs, offset1, offset2, size) {
Function _readOrPeekFixed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Codec.prototype._readOrPeekFixed = function(buf, offset, remaining, doNotConsume, numBytes) {
Function verifyImplementation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var verifyImplementation = function (transportFactory) {
// NOTE: if we only cared about internal modules, 'instanceof' would work, but
// since we're "duck typing" transports to avoid circular dependencies, we have to
// verify the transport prototype differently.
- 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 _dispatchPendingSends
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
SenderLink.prototype._dispatchPendingSends = function(err) {
if (this._pendingSends && this._pendingSends.length !== 0) {
while (this._pendingSends.length > 0 && (!!err ? true : this.canSend())) {
var sendMessage = this._pendingSends.shift();
sendMessage(err);
- 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
Avoid too many return
statements within this function. Open
else if (frame instanceof frames.DispositionFrame) return this._processDispositionFrame(frame);
Avoid too many return
statements within this function. Open
return new ForcedType(field.type, value);
Avoid too many return
statements within this function. Open
if (value instanceof ForcedType) return this.encode(value.value, buffer, value.typeName);
Avoid too many return
statements within this function. Open
else if (frame instanceof frames.FlowFrame) return this._processFlowFrame(frame);
Avoid too many return
statements within this function. Open
if (remaining < 5) return false;
Avoid too many return
statements within this function. Open
if (field.type === '*') return value;
Avoid too many return
statements within this function. Open
return new field.requires(value);
Avoid too many return
statements within this function. Open
if (value.toDescribedType && typeof value.toDescribedType === 'function') return value;
Avoid too many return
statements within this function. Open
if (value.length === 0) return new ForcedType(field.type, null);