Showing 180 of 236 total issues
Function elements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function elements(iterable ...$items): array
{
$elements = [];
if (isset($items[0]) && \is_array($items[0])) {
foreach ($items as $key => $value) {
- 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 mailWriter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$to,
$subject = null,
array $headers = [],
$levels = self::ALL,
$interval = 1,
Method mailWriter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$to,
$subject = null,
array $headers = [],
$levels = self::ALL,
$interval = 1,
Function getReturn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getReturn()
{
if ($this->isTerminated()) {
return !empty($this->result) ? $this->result : $this->finishResult;
} elseif (!$this->isStarted() || $this->isActive() || $this->isErred()) {
- 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 listenerTask
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function listenerTask(callable $handler)
{
return Kernel::away(function () use ($handler) {
$coroutine = \coroutine();
$tid = yield \stateless_task();
- 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
Avoid deeply nested control flow statements. Open
if ($enabled === true)
break;
Function addEvent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addEvent($stream)
{
if (!isset($this->events[(int) $stream])) {
$meta = \stream_get_meta_data($stream);
switch ($meta['stream_type'] ?? '') {
- 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 ioWaiting
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function ioWaiting()
{
$isUv = $this->isUv();
while (true) {
if ($this->isCoroutinesDone()) {
- 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
Avoid deeply nested control flow statements. Open
if (!$this->future->isEmpty())
continue;
Method request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $method = 'GET',
string $path = '/',
?string $type = 'text/html',
$data = null,
array ...$extra
Method net_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$object,
?string $body = null,
?int $status = null,
?string $type = 'text/html',
array ...$extra
Method recvfrom_into
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function recvfrom_into(&$buffer, $nBytes, $flags = \MSG_DONTWAIT, &$address = null, &$port = null);
Method updateCompleted
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
int $taskId,
array $completeList = [],
?callable $onClear = null,
bool $cancel = false,
bool $forceUpdate = false
Method server
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$uri,
?OptionsInterface $context = null,
?string $capath = None,
?string $cafile = None,
array $caSelfDetails = []
Method recvfrom_into
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function recvfrom_into(&$buffer, $nBytes, $flags = \MSG_DONTWAIT, &$address = null, &$port = null)
Method logger_writer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
callable $writer,
$levels = Logger::ALL,
int $interval = 1,
callable $formatter = null,
$name = null
Method net_server
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$uri = null,
?OptionsInterface $context = null,
?string $capath = None,
?string $cafile = None,
array $caSelfDetails = []
Method logger_syslog
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$logOpts = \LOG_PID | \LOG_ODELAY | \LOG_CONS,
$facility = \LOG_USER,
$levels = Logger::ALL,
callable $formatter = null,
$name = null
Method logger_stream
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$stream = 'php://stdout',
$levels = Logger::ALL,
int $interval = 1,
callable $formatter = null,
$name = null
Method spawn_signal
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$command,
int $signal = 0,
$signalTask = null,
$timeout = 0,
bool $display = false