rootslab/vapid

View on GitHub

Showing 32 of 66 total issues

Function commands has a Cognitive Complexity of 196 (exceeds 5 allowed). Consider refactoring.
Open

exports.commands = function () {

    var keys = Object.keys
        , minimatch = require( 'minimatch' )
        , wmsg = function ( cmd ) {
Severity: Minor
Found in lib/commands/pubsub.js - About 4 days 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

Function Vapid has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring.
Open

exports.Vapid = ( function () {
    var log = console.log
        , net = require( 'net' )
        , util = require( 'util' )
        , Bolgia = require( 'bolgia' )
Severity: Minor
Found in lib/vapid.js - About 2 days 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

Function commands has 343 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.commands = function () {

    var keys = Object.keys
        , minimatch = require( 'minimatch' )
        , wmsg = function ( cmd ) {
Severity: Major
Found in lib/commands/pubsub.js - About 1 day to fix

    Function Vapid has 301 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.Vapid = ( function () {
        var log = console.log
            , net = require( 'net' )
            , util = require( 'util' )
            , Bolgia = require( 'bolgia' )
    Severity: Major
    Found in lib/vapid.js - About 1 day to fix

      Function VapidParser has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.VapidParser = ( function () {
          var bconcat = Buffer.concat
              , util = require( 'util' )
              , emitter = require( 'events' ).EventEmitter
              , Bolgia = require( 'bolgia' )
      Severity: Minor
      Found in lib/parser/vapid_parser.js - About 1 day 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

      Function VapidParser has 135 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.VapidParser = ( function () {
          var bconcat = Buffer.concat
              , util = require( 'util' )
              , emitter = require( 'events' ).EventEmitter
              , Bolgia = require( 'bolgia' )
      Severity: Major
      Found in lib/parser/vapid_parser.js - About 5 hrs to fix

        File pubsub.js has 345 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * PUBSUB mix-ins.
         */
        
        exports.commands = function () {
        Severity: Minor
        Found in lib/commands/pubsub.js - About 4 hrs to fix

          Function Vapid has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  , Vapid = function ( opt ) {
                      var me = this
                          , is = me instanceof Vapid
                          ;
                      if ( ! is ) return new Vapid( opt );
          Severity: Major
          Found in lib/vapid.js - About 3 hrs to fix

            File vapid.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Vapid, a vacuous Redis implementation for connection tests,
             * with a fully functional PubSub system for multiple clients.
             *
             * Copyright(c) 2014 Guglielmo Ferri <44gatti@gmail.com>
            Severity: Minor
            Found in lib/vapid.js - About 3 hrs to fix

              Function BulkRule has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.BulkRule = ( function () {
                  var Rule = require('./rule').Rule
                      , util = require( 'util' )
                      , BulkRule = function ( char ) {
                          var me = this
              Severity: Minor
              Found in lib/parser/rules/bulk.js - About 3 hrs 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

              Function onConnection has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              , onConnection = function ( sock ) {
                                  var me = this
                                      , clients = me.clients
                                      , cqueues = me.cqueues
                                      , parsers = me.parsers
              Severity: Major
              Found in lib/vapid.js - About 3 hrs to fix

                Function commands has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.commands = function () {
                
                    var wmsg = function ( cmd ) {
                            return '-ERR wrong number of arguments for \'' + cmd + '\' command\r\n';
                        }
                Severity: Minor
                Found in lib/commands/connection.js - About 2 hrs 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

                Function unsubscribe has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        , unsubscribe : function ( command, args, sock ) {
                            var me = this
                                , channels = me.pubsub.channels
                                , alen = args.length
                                , a = 0
                Severity: Major
                Found in lib/commands/pubsub.js - About 2 hrs to fix

                  Function punsubscribe has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          , punsubscribe : function ( command, args, sock ) {
                             var me = this
                                  , patterns = me.pubsub.patterns
                                  , alen = args.length
                                  , a = 0
                  Severity: Major
                  Found in lib/commands/pubsub.js - About 2 hrs to fix

                    Function BulkRule has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    exports.BulkRule = ( function () {
                        var Rule = require('./rule').Rule
                            , util = require( 'util' )
                            , BulkRule = function ( char ) {
                                var me = this
                    Severity: Major
                    Found in lib/parser/rules/bulk.js - About 2 hrs to fix

                      Function commands has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.commands = function () {
                      
                          var wmsg = function ( cmd ) {
                                  return '-ERR wrong number of arguments for \'' + cmd + '\' command\r\n';
                              }
                      Severity: Major
                      Found in lib/commands/connection.js - About 2 hrs to fix

                        Function resetSubscriptions has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                , resetSubscriptions = function ( sock, pubsub ) {
                                    var pchannels = pubsub.channels
                                        , ppatterns = pubsub.patterns
                                        , schannels = sock.pubsub.channels
                                        , spatterns = sock.pubsub.patterns
                        Severity: Minor
                        Found in lib/vapid.js - About 1 hr to fix

                          Function psubscribe has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  , psubscribe : function ( command, args, sock ) {
                                      var me = this
                                          , patterns = me.pubsub.patterns
                                          , spatterns = null
                                          , alen = args.length
                          Severity: Minor
                          Found in lib/commands/pubsub.js - About 1 hr to fix

                            Function channels has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        channels : function ( command, args, sock ) {
                                            var me = this
                                                , channels = me.pubsub.channels
                                                , alen = args.length
                                                , cmd = command[ 1 ]
                            Severity: Minor
                            Found in lib/commands/pubsub.js - About 1 hr to fix

                              Function Rule has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              exports.Rule = ( function () {
                                  var emitter = require('events').EventEmitter
                                      , util = require( 'util' )
                                      , Abaco = require( 'abaco' )
                                      , max = Math.max
                              Severity: Minor
                              Found in lib/parser/rules/rule.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language