Showing 8 of 8 total issues
Method resolve
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resolve(ResolverInterface $resolver)
{
$type = self::getCallableType($this->callable);
switch ($type) {
Function resolveParameters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function resolveParameters($parameters, ResolverInterface $resolver): \Iterator
{
foreach ($parameters as $param) {
if ($this->hasArgument($param->getName())) {
yield $this->getArgument($param->getName());
- 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 getCallableType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
protected static function getCallableType(callable $callable): int
{
// Closure
if ($callable instanceof \Closure) {
return self::TYPE_CLOSURE;
- 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 too many return
statements within this method. Open
Open
return self::TYPE_STRING_SEPARATED;
Avoid too many return
statements within this method. Open
Open
return $ref->invoke($resolver->resolve($fqcn), ...$args);
Avoid too many return
statements within this method. Open
Open
return call_user_func($this->callable, ...$args);
Avoid too many return
statements within this method. Open
Open
return self::TYPE_UNKNOWN;
Avoid too many return
statements within this method. Open
Open
return self::TYPE_STRING;