Showing 180 of 236 total issues
Avoid too many return
statements within this method. Open
return yield $function(...$arguments);
Avoid too many return
statements within this method. Open
return yield awaitable_future(function () use ($system, $display) {
return Kernel::addFuture($system, 0, $display);
});
Avoid too many return
statements within this method. Open
return @$label(...$arguments);
Avoid too many return
statements within this method. Open
return yield Kernel::gather(...$arguments);
Avoid too many return
statements within this method. Open
return yield $file_function(...$arguments);
Avoid too many return
statements within this method. Open
return yield Kernel::spawnTask($system, 0, $display);
Function needName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function needName()
{
$i = 1;
yield \sleep_for(1);
while (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 close
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function close()
{
$object = $this->customData;
if (\is_object($object)) {
if (\method_exists($object, 'close'))
- 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 add_task
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function add_task(int $tid)
{
$coroutine = \coroutine();
$task = $coroutine->getTask($tid);
if ($task instanceof TaskInterface && $task->hasGroup()) {
- 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 connect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function connect(string $scheme, string $address, int $port, $data = null)
{
return new Kernel(
function (TaskInterface $task, CoroutineInterface $coroutine) use ($scheme, $address, $port, $data) {
$callback = function ($client, $status) use ($task, $coroutine) {
- 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 __timeoutAfter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function __timeoutAfter(float $timeout = 0.0, $callable = null, ...$args)
{
return yield yield new Kernel(
function (TaskInterface $task, CoroutineInterface $coroutine) use ($callable, $timeout, $args) {
$skip = 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 accepting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function accepting()
{
if ($this->secured) {
$client = \stream_socket_accept($this->stream, 0);
if (false === $client)
- 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 getVariable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getVariable(string $key, string $var, $default = '')
{
if ($this->hasVariable($key, $var)) {
$line = $this->getHeader($key);
$sections = \strpos($line, '; ') !== false ? \explode('; ', $line) : [$line];
- 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 join
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function join()
{
$yielding = $this->unfinished_tasks;
if ($this->unfinished_tasks > 0) {
while (!$this->finished) {
- 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 accept
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function accept($server)
{
if (self::isUv() && $server instanceof \UV) {
return yield new Kernel(
function (TaskInterface $task, CoroutineInterface $coroutine) use ($server) {
- 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 file_delete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function file_delete($dir)
{
$dir = slash_switch($dir);
// @codeCoverageIgnoreStart
- 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 union
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function union(...$items): array
{
$current = [];
$elements = $this->elements(...$items);
if (\count($elements) > 0) {
- 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 __invoke
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke()
{
if (!$this->withSet) {
yield $this->withSet();
}
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($options = null)
{
if (!\is_resource($options) && \is_array($options))
$options = \stream_context_create($options);
elseif ($options instanceof OptionsInterface)
- 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 updateScheduler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function updateScheduler(string $type, $stream, bool $removeEvent = false)
{
if ($type == 'read') {
list(, $tasks) = $this->waitingForRead[(int) $stream];
$this->removeReader($stream, $removeEvent);
- 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"