Showing 209 of 236 total issues
Function response
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function response(
?string $body = null,
?int $status = null,
?string $type = 'text/html',
array ...$extra
- 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 await
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function await(string $label, ...$arguments)
{
switch ($label) {
case 'sleep':
case 'sleep_for':
- 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 request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function request(
string $method = 'GET',
string $path = '/',
?string $type = 'text/html',
$data = null,
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($socket = None, $timeout = 1)
{
$isSocketOrStream = (!\IS_PHP8)
? \get_resource_type($socket)
: ($socket instanceof \Socket ? 'Socket' : \get_resource_type($socket));
- 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 executeFiber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function executeFiber(Fiber $fiber)
{
// Skip and reschedule, if `fiber` in suspend state
if ($fiber->isSuspended())
return $this->scheduleFiber($fiber);
- 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 bind
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function bind(string $scheme, string $address, int $port)
{
$uv = \coroutine()->getUV();
$ip = (\strpos($address, ':') === false)
? \uv_ip4_addr($address, $port)
Method write
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function write($handle, $data = '')
{
if (self::isUv() && $handle instanceof \UV) {
if (\uv_is_closing($handle))
return false;
Method close
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function close()
{
$object = $this->customData;
if (\is_object($object)) {
if (\method_exists($object, 'close'))
Method result
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function result()
{
if ($this->isCompleted()) {
$result = $this->result;
if ($this->customData instanceof FutureInterface)
Method timeout
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function timeout()
{
$coroutine = \coroutine();
$timeout = $this->clock;
$task = $this->withTask();
Method request
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function request(
string $method = 'GET',
string $path = '/',
?string $type = 'text/html',
$data = null,
Method addFuture
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$command,
$timeout = 0,
bool $display = false,
$channel = null,
$channelTask = null,
Function _fopen
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _fopen(string $path = null, string $flag = 'r', int $mode = \S_IRWXU, $contexts = null)
{
$retry = 0;
while (true) {
$fd = yield FileSystem::open($path, $flag, $mode, $contexts);
- 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 joinTask
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function joinTask(int $tid)
{
return new Kernel(
function (TaskInterface $task, CoroutineInterface $coroutine) use ($tid) {
$join = $coroutine->getTask($tid);
- 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 get_local
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get_local()
{
if ($this->secured) {
if (\is_resource($this->stream))
return \stream_socket_get_name($this->stream, 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 get_peer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get_peer()
{
if ($this->secured) {
if (\is_resource($this->stream))
return \stream_socket_get_name($this->stream, 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 __call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __call($function, $args)
{
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 clearTimeout
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function clearTimeout(TaskInterface $task): void
{
$timer = $task->getTimer();
if ($this->isUv() && $timer instanceof \UVTimer && \uv_is_active($timer)) {
@\uv_timer_stop($timer);
- 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 updateCompleted
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function updateCompleted(
int $taskId,
array $completeList = [],
?callable $onClear = null,
bool $cancel = 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
Method logger_mail
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $to = '',
$subject = '',
array $headers = [],
$levels = Logger::ALL,
int $interval = 1,