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 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 _sendMessage
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
SenderLink.prototype._sendMessage = function(message, options) {
// preconditions
if (this.linkCredit <= 0) {
throw new errors.OverCapacityError('Cannot send if no link credit.');
}
Function _sendMessage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
SenderLink.prototype._sendMessage = function(message, options) {
// preconditions
if (this.linkCredit <= 0) {
throw new errors.OverCapacityError('Cannot send if no link credit.');
}
- 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 _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"