Showing 42 of 1,086 total issues
Function compile
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
static function compile(array $tokens, array &$params, array $defaults = [], callable $wildcard = null) : string
{
$current = [
'is_optional' => false,
'skip' => 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
File Resolver.php
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
*/
Function emit
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
static function emit(callable $callable, array $args = [], callable $callback = null)
{
if ($args && !is_string(key($args))) {
return $callable(...$args);
}
- 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 gem
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function gem(Gem $gem, array $args = [])
{
if ($gem instanceof Factory) {
return $this->invoke($this->child($gem, $args));
}
- 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 gem
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function gem(Gem $gem, array $args = [])
{
if ($gem instanceof Factory) {
return $this->invoke($this->child($gem, $args));
}
File init.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
*/
include __DIR__ . '/src/Signal.php';
Function hydrate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function hydrate(Plugin $plugin, $service)
{
foreach($plugin->calls() as $method => $args) {
if (is_string($method)) {
if (INDEX == $method[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 create
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
static function create(string $name, array $args, callable $callback)
{
$class = static::reflectionClass($name);
if (null === $class->constructor()) {
- 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
static function emit(callable $callable, array $args = [], callable $callback = null)
{
if ($args && !is_string(key($args))) {
return $callable(...$args);
}
Method compile
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
static function compile(array $tokens, array &$params, array $defaults = [], callable $wildcard = null) : string
{
$current = [
'is_optional' => false,
'skip' => true,
Function regex
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function regex(array $tokens) : string
{
$regex = '';
foreach($tokens as $token) {
- 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 create
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static function create(string $name, array $args, callable $callback)
{
$class = static::reflectionClass($name);
if (null === $class->constructor()) {
Method tokens
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tokens(string $path, array $constraints = []) : array
{
$currentPos = 0;
$length = strlen($path);
$level = 0;
Function tokens
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function tokens(string $path, array $constraints = []) : array
{
$currentPos = 0;
$length = strlen($path);
$level = 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
Method hydrate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function hydrate(Plugin $plugin, $service)
{
foreach($plugin->calls() as $method => $args) {
if (is_string($method)) {
if (INDEX == $method[0]) {
Method errorException
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $message = '', int $code = 0, int $severity = E_ERROR,
string $file = __FILE__, int $line = __LINE__, \Throwable $previous = null, int $offset = 2
Method match
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function match(Route $route, Request $request, string $path, int $offset, callable $next)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function __construct(string $name = null, array $args = [], array $calls = [], string $param = null, bool $merge = false)
Method repeat
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function repeat($plugin, string $method, array $name = [], array $args = [], callable $callback = null)
Method iterate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function iterate($result, $event, Iterator $iterator, array $args, callable $callback = null)