Showing 100 of 100 total issues
Avoid too many return
statements within this method. Open
return $autowired;
Avoid too many return
statements within this method. Open
return $this->builder?->val($callback) ?? $callback;
Avoid too many return
statements within this method. Open
return !isset($autowired) ? $s : [$s];
Avoid too many return
statements within this method. Open
return [$resolver($type)];
Avoid too many return
statements within this method. Open
return $resolved ?? $this->cache[$callback];
Avoid too many return
statements within this method. Open
return $this->get($itemType, true);
Avoid too many return
statements within this method. Open
return \array_map($resolver, $type->getTypes());
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $this->container->get($reference, $invalidBehavior);
Avoid too many return
statements within this method. Open
return $this->get($itemType);
Function tags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function tags(array $tags): void
{
foreach ($tags as $tag => $serviceIds) {
foreach ((array) $serviceIds as $serviceId => $value) {
if (\is_numeric($serviceId)) {
- 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 type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function type(string $id, string ...$type): void
{
foreach ((array) $type as $typed) {
if (!\Nette\Utils\Validators::isType($typed)) {
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
Function __destruct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __destruct()
{
if (!empty($this->classes)) {
foreach ($this->classes as [$definition, $classes]) {
// prepare for deep cloning
- 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 reset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function reset(): void
{
foreach ($this->definitions as $id => $service) {
$service = $this->services[$id] ?? $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 alias
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function alias(string $id, Reference|string $service): void
{
$service = \explode('@', (string) $service, 2);
if ($id === $service[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 __call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __call(string $name, array $arguments)
{
if (!$this->condition) {
return $this;
}
- 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 modifyConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function modifyConfig(string $extensionName, array $configuration, string $parent = null, bool $replace = false): void
{
if (!\array_key_exists($extensionName, $this->extensions)) {
throw new \InvalidArgumentException(\sprintf('The extension "%s" provided in not valid, must be an extension\'s class name.', $extensionName));
}
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get(string $id, bool $single = false): mixed
{
if ($this->container->typed($id)) {
return $this->container->autowired($id, $single);
}
- 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 pStmt_Property
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function pStmt_Property(\PhpParser\Node\Stmt\Property $node): string
{
if ('tags' === $node->props[0]->name->name) {
$item = $node->props[0]->default;
- 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 getTags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getTags(): array
{
if (null !== $this->container) {
$tags = [];
- 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"