Showing 100 of 100 total issues
Method autowireArgument
has 57 lines of code (exceeds 25 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) {
Function doCreate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function doCreate(object $definition): void
{
$this->trackDefaults = false;
foreach ($this->defaults as $offset => $defaultMethods) {
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function resolve(Container $container): array
{
$i = 0;
$services = $refs = [];
- 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 autowireArguments
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function autowireArguments(\ReflectionFunctionAbstract $function, array $args = []): array
{
$resolvedParameters = [];
$nullValuesFound = 0;
$args = $this->resolveArguments($args); // Resolves provided arguments.
- 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 54 lines of code (exceeds 25 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));
}
Function resolveClass
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function resolveClass(string $class, array $args = []): object
{
if (\is_subclass_of($class, ServiceProviderInterface::class)) {
$services = [];
- 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 doLoad
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function doLoad(string $id, int $invalidBehavior): mixed
{
if (null == ($definition = $this->definitions[$id] ?? null)) {
if (\array_key_exists($id, $this->types)) {
return $this->autowired($id, 1 === ($invalidBehavior & self::EXCEPTION_ON_MULTIPLE_SERVICE));
- 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 removeDefinition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function removeDefinition(string $id): void
{
unset($this->definitions[$id], $this->services[$id]);
foreach ($this->aliases as $alias => $aliased) {
- 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 boot
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container instanceof ContainerBuilder) {
foreach ($this->config as $name => $value) {
if (null === $value) {
- 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 afterTraverse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function afterTraverse(array $nodes)
{
foreach ($nodes as $node) {
if ($node instanceof Class_) {
foreach ($node->stmts as $methodNode) {
- 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 doAnalyse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function doAnalyse(array $definitions, bool $onlyDefinitions = false): array
{
$methodsMap = $serviceMethods = $wiredTypes = [];
if (!isset($methodsMap[self::SERVICE_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
Method compile
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compile(array $options = [])
{
$options += ['strictType' => true, 'printToString' => true, 'containerClass' => 'CompiledContainer'];
$astNodes = $options['strictType'] ? [new Declare_([new DeclareDeclare('strict_types', $this->resolver->getBuilder()->val(1))])] : [];
$processedData = $this->doAnalyse($this->definitions);
Method getResolved
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getResolved(Resolver $resolver, object $service, \ReflectionClass $reflection): object
{
$properties = [];
foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
Method autowireService
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function autowireService(mixed $definition, bool $allTypes = false, Container $container = null): array
{
$types = $autowired = [];
if (\is_callable($definition)) {
Function sortExtensions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function sortExtensions(array $extensions): array
{
if (0 === \count($extensions)) {
return [];
}
- 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 setContainer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function setContainer(Container $container, string $id, bool $anonymous = false)
{
$this->container = $container;
$this->id = $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 resolveArguments
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function resolveArguments(array $arguments = []): array
{
foreach ($arguments as $key => $value) {
if (\is_array($value)) {
$resolved = $this->resolveArguments($value);
- 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 findClasses
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findClasses(string $namespace, string $pattern, array $excludePatterns): array
{
$classNames = [];
$container = $this->container;
Method doAnalyse
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doAnalyse(array $definitions, bool $onlyDefinitions = false): array
{
$methodsMap = $serviceMethods = $wiredTypes = [];
if (!isset($methodsMap[self::SERVICE_CONTAINER])) {
Function afterTraverse
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function afterTraverse(array $nodes)
{
$node = $nodes[1] ?? $nodes[0];
if (isset($nodes[0]) && $nodes[0] instanceof Declare_) {
- 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"