divineniiquaye/rade-di

View on GitHub

Showing 100 of 100 total issues

Avoid too many return statements within this method.
Open

        return $autowired;
Severity: Major
Found in src/Resolver.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $this->builder?->val($callback) ?? $callback;
    Severity: Major
    Found in src/Resolver.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                              return !isset($autowired) ? $s : [$s];
      Severity: Major
      Found in src/Resolver.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return [$resolver($type)];
        Severity: Major
        Found in src/Resolver.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $resolved ?? $this->cache[$callback];
          Severity: Major
          Found in src/Resolver.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                    return $this->get($itemType, true);
            Severity: Major
            Found in src/Resolver.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return \array_map($resolver, $type->getTypes());
              Severity: Major
              Found in src/Resolver.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return null;
                Severity: Major
                Found in src/Resolver.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $this->container->get($reference, $invalidBehavior);
                  Severity: Major
                  Found in src/Resolver.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return $this->get($itemType);
                    Severity: Major
                    Found in src/Resolver.php - About 30 mins to fix

                      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)) {
                      Severity: Minor
                      Found in src/Traits/TagsTrait.php - About 25 mins to fix

                      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;
                      Severity: Minor
                      Found in src/Traits/TypesTrait.php - About 25 mins to fix

                      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
                      Severity: Minor
                      Found in src/DefinitionBuilder.php - About 25 mins to fix

                      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;
                      
                      
                      Severity: Minor
                      Found in src/Container.php - About 25 mins to fix

                      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]) {
                      Severity: Minor
                      Found in src/Traits/AliasTrait.php - About 25 mins to fix

                      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;
                              }
                      Severity: Minor
                      Found in src/DefinitionBuilder.php - About 25 mins to fix

                      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));
                              }
                      Severity: Minor
                      Found in src/Extensions/ExtensionBuilder.php - About 25 mins to fix

                      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);
                              }
                      Severity: Minor
                      Found in src/Resolver.php - About 25 mins to fix

                      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;
                      
                      
                      Severity: Minor
                      Found in src/Builder/CodePrinter.php - About 25 mins to fix

                      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 = [];
                      
                      
                      Severity: Minor
                      Found in src/Definition.php - About 25 mins to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language