Showing 58 of 158 total issues
File socket.io.js
has 2596 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Socket.IO v4.4.1
* (c) 2014-2022 Guillermo Rauch
* Released under the MIT License.
*/
Function Socket$1
has 404 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Socket$1 = /*#__PURE__*/function (_Emitter) {
_inherits(Socket, _Emitter);
var _super = _createSuper(Socket);
Function Socket
has 367 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Socket = /*#__PURE__*/function (_Emitter) {
_inherits(Socket, _Emitter);
var _super = _createSuper(Socket);
Function Manager
has 280 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Manager = /*#__PURE__*/function (_Emitter) {
_inherits(Manager, _Emitter);
var _super = _createSuper(Manager);
File index.ts
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import http = require("http");
import { createReadStream } from "fs";
import { createDeflate, createGzip, createBrotliCompress } from "zlib";
import accepts = require("accepts");
import { pipeline } from "stream";
File socket.ts
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Packet, PacketType } from "socket.io-parser";
import debugModule from "debug";
import type { Server } from "./index";
import {
EventParams,
Socket
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Socket<
ListenEvents extends EventsMap = DefaultEventsMap,
EmitEvents extends EventsMap = ListenEvents,
ServerSideEvents extends EventsMap = DefaultEventsMap,
SocketData = any
Function Polling
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Polling = /*#__PURE__*/function (_Transport) {
_inherits(Polling, _Transport);
var _super = _createSuper(Polling);
Function Request
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Request = /*#__PURE__*/function (_Emitter) {
_inherits(Request, _Emitter);
var _super2 = _createSuper(Request);
Function Decoder
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Decoder = /*#__PURE__*/function (_Emitter) {
_inherits(Decoder, _Emitter);
var _super = _createSuper(Decoder);
Function WS
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var WS = /*#__PURE__*/function (_Transport) {
_inherits(WS, _Transport);
var _super = _createSuper(WS);
Function default
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
export class Server<
ListenEvents extends EventsMap = DefaultEventsMap,
EmitEvents extends EventsMap = ListenEvents,
ServerSideEvents extends EventsMap = DefaultEventsMap,
SocketData = any
Function Transport
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Transport = /*#__PURE__*/function (_Emitter) {
_inherits(Transport, _Emitter);
var _super = _createSuper(Transport);
Function probe
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function probe(name) {
var _this4 = this;
var transport = this.createTransport(name);
var failed = false;
Function Socket
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Socket(uri) {
var _this;
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
Function patchAdapter
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function default
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function (components: Components) {
const { todoRepository } = components;
return {
createTodo: async function (
payload: Omit<Todo, "id">,
- 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
Namespace
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Namespace<
ListenEvents extends EventsMap = DefaultEventsMap,
EmitEvents extends EventsMap = ListenEvents,
ServerSideEvents extends EventsMap = DefaultEventsMap,
SocketData = any
Function XHR
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var XHR = /*#__PURE__*/function (_Polling) {
_inherits(XHR, _Polling);
var _super = _createSuper(XHR);