Showing 15 of 19 total issues
Function emit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
emit(channel, data) {
let event = this.parseEvent(data),
room = event.data.room,
nsp = '';
- 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
Function parseDsn
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function parseDsn($dsn)
{
$dsn = str_replace('redis://', '', $dsn); // remove "redis://"
if (false !== $pos = strrpos($dsn, '@')) {
// parse password
- 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
Function predis
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function predis(SymfonyStyle $io)
{
$pubSubLoop = function () use ($io) {
/** @var \Predis\Client $client */
$client = $this->redisDriver->getClient(true);
- 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
Function on
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
on(channel, data) {
let nsp = '/' + this.getIoNsp(channel);
let nspio = this.io.of(nsp);
nspio.on('connection', (socket) => {
Method predis
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function predis(SymfonyStyle $io)
{
$pubSubLoop = function () use ($io) {
/** @var \Predis\Client $client */
$client = $this->redisDriver->getClient(true);
Function emit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
emit(channel, data) {
let event = this.parseEvent(data),
room = event.data.room,
nsp = '';
Function getList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getList(): array
{
//@todo remove this, move to extension using tags
if (empty(self::$list)) {
foreach ($this->namespaces as $key => $namespace) {
- 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
Method parseDsn
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseDsn($dsn)
{
$dsn = str_replace('redis://', '', $dsn); // remove "redis://"
if (false !== $pos = strrpos($dsn, '@')) {
// parse password
Method emit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function emit(string $event, array $data)
{
$this->logger->info(json_encode(['type' => 'emit', 'name' => $event, 'data' => $data]));
try {
Method process
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(string $handler, array $data)
{
try {
/** @var EventInterface|EventSubscriberInterface|EventPolicyInterface $eventHandler */
$eventHandler = $this->manager->resolve($handler); //container->get(sprintf('socketio.%s', $handler));
Function process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function process(string $handler, array $data)
{
try {
/** @var EventInterface|EventSubscriberInterface|EventPolicyInterface $eventHandler */
$eventHandler = $this->manager->resolve($handler); //container->get(sprintf('socketio.%s', $handler));
- 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
Function createBroadcast
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function createBroadcast(array $config, ContainerBuilder $container)
{
$broadcast = new Definition(Broadcast::class);
$broadcast->setArguments([
new Reference(RedisDriver::class),
- 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
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (socket, next) => {
const token = socket.handshake.query[`${process.env.SOCKET_IO_AUTH_TOKEN_NAME || 'token'}`];
const callback = (err, decoded) => {
if (err) {
logger.info("auth", err);
- 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
Function isDdos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isDdos(name) {
let data = (this.socket.accessIo || {})[name] || {};
if (this.getRequestLimit() <= 0) {
return false;
- 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
Function emit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function emit(string $event, array $data)
{
$this->logger->info(json_encode(['type' => 'emit', 'name' => $event, 'data' => $data]));
try {
- 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"