Showing 6 of 6 total issues
Function predis
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function predis()
{
$pubSubLoop = function () {
$client = Broadcast::getDriver()->getConnection(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
Method predis
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function predis()
{
$pubSubLoop = function () {
$client = Broadcast::getDriver()->getConnection(true);
Function on
has 30 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) => {
Function getList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getList(): array
{
if (empty(static::$list)) {
foreach ($this->namespaces as $key => $namespace) {
$alias = Yii::getAlias('@' . str_replace('\\', '/', trim($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 emit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function emit(string $event, array $data)
{
$eventClassName = self::getManager()->getList()[$event] ?? null;
try {
if (null === $eventClassName) {
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"