Showing 9 of 9 total issues
Function from
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AMQPQueuesManager.prototype.from = function(queue, readyCallback, callback) {
var that = this;
// ready callback is optional
if (callback === null) {
callback = readyCallback;
Function from
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
STOMPQueuesManager.prototype.from = function(queue, readyCallback, callback) {
var that = this;
// ready callback is optional
if (callback === null) {
callback = readyCallback;
Function STOMPQueuesManager
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function STOMPQueuesManager(client, callback) {
EventEmitter.call(this);
var that = this;
that.client = client;
Function AMQPQueuesManager
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AMQPQueuesManager(connection, callback) {
EventEmitter.call(this);
var that = this;
that.connection = connection;
Function responseCallback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var responseCallback = function(err, responseMessage, responseHeaders, responseAckCallback) {
if (err) {
that.client.nack(headers['message-id']);
} else {
that.client.ack(headers['message-id']);
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(protocol, connection, callback) {
// case where an amqp connection is given already prepared
if (protocol === 'amqp' && _.deepGet(connection, 'options.clientProperties.product') === 'node-amqp') {
new AMQPQueuesManager(connection, callback);
}
Function inOut
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
AMQPQueuesManager.prototype.inOut = function(queue, message, headers, publishOptions, callback) {
Function to
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
AMQPQueuesManager.prototype.to = function(queue, message, headers, publishOptions, callback) {
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(protocol, connection, callback) {
// case where an amqp connection is given already prepared
if (protocol === 'amqp' && _.deepGet(connection, 'options.clientProperties.product') === 'node-amqp') {
new AMQPQueuesManager(connection, callback);
}
- 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"