guidesmiths/rascal

View on GitHub
lib/amqp/Subscription.js

Summary

Maintainability
B
6 hrs
Test Coverage
A
91%

File Subscription.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const debug = require('debug')('rascal:Subscription');
const _ = require('lodash');
const format = require('util').format;
const crypto = require('crypto');
const async = require('async');
Severity: Minor
Found in lib/amqp/Subscription.js - About 2 hrs to fix

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

      function decrypt(algorithm, keyHex, ivHex, encrypted, next) {
    Severity: Minor
    Found in lib/amqp/Subscription.js - About 35 mins to fix

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

        function ackOrNack(session, message, err, options, next) {
      Severity: Minor
      Found in lib/amqp/Subscription.js - About 35 mins to fix

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

          create(broker, vhost, counter, config, next) {
        Severity: Minor
        Found in lib/amqp/Subscription.js - About 35 mins to fix

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

            function handleChannelError(session, config, removeDisconnectionHandler, attempt, err) {
          Severity: Minor
          Found in lib/amqp/Subscription.js - About 35 mins to fix

            Avoid too many return statements within this function.
            Open

                if (err) return subscriberError.handle(session, message, err, options, next);
            Severity: Major
            Found in lib/amqp/Subscription.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  if (arguments.length === 4) return ackOrNack(session, message, err, options, emitOnError.bind(null, session));
              Severity: Major
              Found in lib/amqp/Subscription.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    if (options && options.all) return session._ackAll(message, next);
                Severity: Major
                Found in lib/amqp/Subscription.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      if (message.__rascal_acknowledged) return next(new Error('ackOrNack should only be called once per message'));
                  Severity: Major
                  Found in lib/amqp/Subscription.js - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status