Showing 100 of 100 total issues
Function resolve
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
public function resolve(Resolver $resolver, bool $createMethod = false): mixed
{
if (($this->options['abstract'] ?? false)) {
throw new ContainerResolutionException(\sprintf('Resolving an abstract definition %s is not allowed.', $this->id));
}
- 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 build
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
protected function build(Resolver $resolver, p\BuilderFactory $builder, bool $createMethod): p\Node\Expr|p\Node\Stmt\ClassMethod
{
$defNode = $builder->method($resolver::createMethod($this->id))->makeProtected();
$defTyped = $defNodes = [];
- 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 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
Function autowireArgument
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function autowireArgument(\ReflectionParameter $parameter, array $types, array $providedParameters): mixed
{
foreach ($types as $typeName) {
if (\PHP_MAJOR_VERSION >= 8 && $attributes = $parameter->getAttributes()) {
foreach ($attributes as $attribute) {
- 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 resolve
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($callback, array $args = []): mixed
{
if (\is_object($callback) && isset($this->cache[$callback])) {
return $this->cache[$callback];
}
- 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 findClasses
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private function findClasses(string $namespace, string $pattern, array $excludePatterns): array
{
$classNames = [];
$container = $this->container;
- 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 autowireService
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public static function autowireService(mixed $definition, bool $allTypes = false, Container $container = null): array
{
$types = $autowired = [];
if (\is_callable($definition)) {
- 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
Definition
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Definition
{
use Traits\DefinitionAwareTrait;
public function __construct(mixed $entity, private array $arguments = [])
Function resolveStmt
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function resolveStmt(array $expressions, string $parentId, bool $leaveNodes = false): void
{
foreach ($expressions as &$expression) {
if ($expression instanceof Expression || $expression instanceof Return_) {
$expression = $expression->expr;
- 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 getResolved
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public static function getResolved(Resolver $resolver, object $service, \ReflectionClass $reflection): object
{
$properties = [];
foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
- 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 resolveProxies
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function resolveProxies(ContainerBuilder $container, BuilderFactory $builder, array $proxiedServices): array
{
$builtProxies = [];
foreach ($proxiedServices as $method => $proxy) {
- 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 bootExtensions
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function bootExtensions(array $extensions, \SplStack &$afterLoading, string $extraKey = null): void
{
$container = $this->container;
foreach ($extensions as $resolved) {
- 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 build
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function build(Resolver $resolver, p\BuilderFactory $builder, bool $createMethod): p\Node\Expr|p\Node\Stmt\ClassMethod
{
$defNode = $builder->method($resolver::createMethod($this->id))->makeProtected();
$defTyped = $defNodes = [];
File DefinitionBuilder.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
Function findResourcePath
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function findResourcePath(string $namespace): string
{
foreach (\spl_autoload_functions() as $classLoader) {
if (!\is_array($classLoader)) {
continue;
- 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 resolve
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolve($callback, array $args = []): mixed
{
if (\is_object($callback) && isset($this->cache[$callback])) {
return $this->cache[$callback];
}
Function resolveReference
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function resolveReference(string $reference): mixed
{
$invalidBehavior = $this->container::EXCEPTION_ON_MULTIPLE_SERVICE;
if ('?' === $reference[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
File Definition.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
DefinitionBuilder
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class DefinitionBuilder implements ResetInterface
{
private ?string $definition = null, $directory = null;
private bool $trackDefaults = false, $condition = true;
Function resolveCallable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function resolveCallable(callable|array $callback, array $arguments = []): mixed
{
if (\is_array($callback)) {
if ((2 === \count($callback) && \array_is_list($callback)) && \is_string($callback[1])) {
$callback[0] = $this->resolve($callback[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"