lib/common/messenger.js
Function messengerFactory
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function messengerFactory(
Constants,
Promise,
assert,
Connection,
Function messengerFactory
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
function messengerFactory(
Constants,
Promise,
assert,
Connection,
- 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 messenger.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Copyright 2015, EMC, Inc.
'use strict';
module.exports = messengerFactory;
Function messengerFactory
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Constants,
Promise,
assert,
Connection,
Message,
Function start
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Messenger.prototype.start = function () {
var self = this,
configuration = injector.get('Services.Configuration'),
uri = configuration.get('amqp', 'amqp://localhost');
Function subscribe
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Messenger.prototype.subscribe = function (name, routingKey, callback, type) {
assert.string(name, 'name');
assert.string(routingKey, 'routingKey');
assert.func(callback, 'callback');
Function request
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Messenger.prototype.request = function (name, routingKey, data, type, timeout) {
assert.string(name, 'name');
assert.string(routingKey, 'routingKey');
assert.object(data, 'data');
Function subscribeTimeout
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Messenger.prototype.subscribeTimeout = function(context, data, headers, deliveryInfo) {
clearTimeout(context.timeout);
this.safeSubscriptionDispose(context);
Function request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Messenger.prototype.request = function (name, routingKey, data, type, timeout) {