socketio/socket.io

View on GitHub

Showing 58 of 158 total issues

File socket.io.js has 2596 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Socket.IO v4.4.1
 * (c) 2014-2022 Guillermo Rauch
 * Released under the MIT License.
 */
Severity: Major
Found in client-dist/socket.io.js - About 1 wk to fix

    Function Socket$1 has 404 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var Socket$1 = /*#__PURE__*/function (_Emitter) {
        _inherits(Socket, _Emitter);
    
        var _super = _createSuper(Socket);
    
    
    Severity: Major
    Found in client-dist/socket.io.js - About 2 days to fix

      Function Socket has 367 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var Socket = /*#__PURE__*/function (_Emitter) {
          _inherits(Socket, _Emitter);
      
          var _super = _createSuper(Socket);
      
      
      Severity: Major
      Found in client-dist/socket.io.js - About 1 day to fix

        Function Manager has 280 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var Manager = /*#__PURE__*/function (_Emitter) {
            _inherits(Manager, _Emitter);
        
            var _super = _createSuper(Manager);
        
        
        Severity: Major
        Found in client-dist/socket.io.js - About 1 day to fix

          File index.ts has 484 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import http = require("http");
          import { createReadStream } from "fs";
          import { createDeflate, createGzip, createBrotliCompress } from "zlib";
          import accepts = require("accepts");
          import { pipeline } from "stream";
          Severity: Minor
          Found in lib/index.ts - About 7 hrs to fix

            File socket.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Packet, PacketType } from "socket.io-parser";
            import debugModule from "debug";
            import type { Server } from "./index";
            import {
              EventParams,
            Severity: Minor
            Found in lib/socket.ts - About 5 hrs to fix

              Socket has 40 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class Socket<
                ListenEvents extends EventsMap = DefaultEventsMap,
                EmitEvents extends EventsMap = ListenEvents,
                ServerSideEvents extends EventsMap = DefaultEventsMap,
                SocketData = any
              Severity: Minor
              Found in lib/socket.ts - About 5 hrs to fix

                Function Polling has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var Polling = /*#__PURE__*/function (_Transport) {
                    _inherits(Polling, _Transport);
                
                    var _super = _createSuper(Polling);
                
                
                Severity: Major
                Found in client-dist/socket.io.js - About 4 hrs to fix

                  Function Request has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var Request = /*#__PURE__*/function (_Emitter) {
                      _inherits(Request, _Emitter);
                  
                      var _super2 = _createSuper(Request);
                  
                  
                  Severity: Major
                  Found in client-dist/socket.io.js - About 4 hrs to fix

                    Function Decoder has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var Decoder = /*#__PURE__*/function (_Emitter) {
                        _inherits(Decoder, _Emitter);
                    
                        var _super = _createSuper(Decoder);
                    
                    
                    Severity: Major
                    Found in client-dist/socket.io.js - About 4 hrs to fix

                      Function WS has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var WS = /*#__PURE__*/function (_Transport) {
                          _inherits(WS, _Transport);
                      
                          var _super = _createSuper(WS);
                      
                      
                      Severity: Major
                      Found in client-dist/socket.io.js - About 4 hrs to fix

                        Function default has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function (components: Components) {
                          const { todoRepository } = components;
                          return {
                            createTodo: async function (
                              payload: Omit<Todo, "id">,

                          Server has 32 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          export class Server<
                            ListenEvents extends EventsMap = DefaultEventsMap,
                            EmitEvents extends EventsMap = ListenEvents,
                            ServerSideEvents extends EventsMap = DefaultEventsMap,
                            SocketData = any
                          Severity: Minor
                          Found in lib/index.ts - About 4 hrs to fix

                            Function Transport has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var Transport = /*#__PURE__*/function (_Emitter) {
                                _inherits(Transport, _Emitter);
                            
                                var _super = _createSuper(Transport);
                            
                            
                            Severity: Major
                            Found in client-dist/socket.io.js - About 2 hrs to fix

                              Function probe has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    value: function probe(name) {
                                      var _this4 = this;
                              
                                      var transport = this.createTransport(name);
                                      var failed = false;
                              Severity: Major
                              Found in client-dist/socket.io.js - About 2 hrs to fix

                                Function Socket has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function Socket(uri) {
                                      var _this;
                                
                                      var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
                                
                                
                                Severity: Major
                                Found in client-dist/socket.io.js - About 2 hrs to fix

                                  Function patchAdapter has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function patchAdapter(app /* : TemplatedApp */) {
                                    Adapter.prototype.addAll = function (id, rooms) {
                                      const isNew = !this.sids.has(id);
                                      addAll.call(this, id, rooms);
                                      const socket: Socket = this.nsp.sockets.get(id);
                                  Severity: Major
                                  Found in lib/uws.ts - About 2 hrs to fix

                                    Function default has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export default function (components: Components) {
                                      const { todoRepository } = components;
                                      return {
                                        createTodo: async function (
                                          payload: Omit<Todo, "id">,

                                    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

                                    Namespace has 22 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    export class Namespace<
                                      ListenEvents extends EventsMap = DefaultEventsMap,
                                      EmitEvents extends EventsMap = ListenEvents,
                                      ServerSideEvents extends EventsMap = DefaultEventsMap,
                                      SocketData = any
                                    Severity: Minor
                                    Found in lib/namespace.ts - About 2 hrs to fix

                                      Function XHR has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        var XHR = /*#__PURE__*/function (_Polling) {
                                          _inherits(XHR, _Polling);
                                      
                                          var _super = _createSuper(XHR);
                                      
                                      
                                      Severity: Major
                                      Found in client-dist/socket.io.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language