albanm/nsi-queues

View on GitHub

Showing 9 of 9 total issues

Function from has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

AMQPQueuesManager.prototype.from = function(queue, readyCallback, callback) {
    var that = this;
    // ready callback is optional
    if (callback === null) {
        callback = readyCallback;
Severity: Minor
Found in lib/amqp.js - About 1 hr to fix

    Function from has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    STOMPQueuesManager.prototype.from = function(queue, readyCallback, callback) {
        var that = this;
        // ready callback is optional
        if (callback === null) {
            callback = readyCallback;
    Severity: Minor
    Found in lib/stomp.js - About 1 hr to fix

      Function STOMPQueuesManager has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function STOMPQueuesManager(client, callback) {
          EventEmitter.call(this);
      
          var that = this;
          that.client = client;
      Severity: Minor
      Found in lib/stomp.js - About 1 hr to fix

        Function AMQPQueuesManager has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function AMQPQueuesManager(connection, callback) {
            EventEmitter.call(this);
        
            var that = this;
            that.connection = connection;
        Severity: Minor
        Found in lib/amqp.js - About 1 hr to fix

          Function responseCallback has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var responseCallback = function(err, responseMessage, responseHeaders, responseAckCallback) {
                      if (err) {
                          that.client.nack(headers['message-id']);
                      } else {
                          that.client.ack(headers['message-id']);
          Severity: Minor
          Found in lib/stomp.js - About 1 hr to fix

            Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            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);
                }
            Severity: Minor
            Found in index.js - About 1 hr to fix

              Function inOut has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              AMQPQueuesManager.prototype.inOut = function(queue, message, headers, publishOptions, callback) {
              Severity: Minor
              Found in lib/amqp.js - About 35 mins to fix

                Function to has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                AMQPQueuesManager.prototype.to = function(queue, message, headers, publishOptions, callback) {
                Severity: Minor
                Found in lib/amqp.js - About 35 mins to fix

                  Function exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  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);
                      }
                  Severity: Minor
                  Found in index.js - About 35 mins to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language