Showing 42 of 1,086 total issues

Function compile has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    static function compile(array $tokens, array &$params, array $defaults = [], callable $wildcard = null) : string
    {
        $current = [
            'is_optional' => false,
            'skip'        => true,
Severity: Minor
Found in src/Route/Definition/Compiler.php - About 4 hrs 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

File Resolver.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 *
 */

Severity: Minor
Found in src/Resolver/Resolver.php - About 4 hrs to fix

    Function emit has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        static function emit(callable $callable, array $args = [], callable $callback = null)
        {
            if ($args && !is_string(key($args))) {
                return $callable(...$args);
            }
    Severity: Minor
    Found in src/Signal.php - About 3 hrs 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 gem has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function gem(Gem $gem, array $args = [])
        {
            if ($gem instanceof Factory) {
                return $this->invoke($this->child($gem, $args));
            }
    Severity: Minor
    Found in src/Resolver/Resolver.php - About 3 hrs 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

    Method gem has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function gem(Gem $gem, array $args = [])
        {
            if ($gem instanceof Factory) {
                return $this->invoke($this->child($gem, $args));
            }
    Severity: Major
    Found in src/Resolver/Resolver.php - About 2 hrs to fix

      File init.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       *
       */
      include __DIR__ . '/src/Signal.php';
      Severity: Minor
      Found in init.php - About 2 hrs to fix

        Function hydrate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function hydrate(Plugin $plugin, $service)
            {
                foreach($plugin->calls() as $method => $args) {
                    if (is_string($method)) {
                        if (INDEX == $method[0]) {
        Severity: Minor
        Found in src/Resolver/Resolver.php - About 2 hrs 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 create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            static function create(string $name, array $args, callable $callback)
            {
                $class = static::reflectionClass($name);
        
                if (null === $class->constructor()) {
        Severity: Minor
        Found in src/Service/Builder.php - About 2 hrs 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

        Method emit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static function emit(callable $callable, array $args = [], callable $callback = null)
            {
                if ($args && !is_string(key($args))) {
                    return $callable(...$args);
                }
        Severity: Major
        Found in src/Signal.php - About 2 hrs to fix

          Method compile has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static function compile(array $tokens, array &$params, array $defaults = [], callable $wildcard = null) : string
              {
                  $current = [
                      'is_optional' => false,
                      'skip'        => true,
          Severity: Major
          Found in src/Route/Definition/Compiler.php - About 2 hrs to fix

            Function regex has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function regex(array $tokens) : string
                {
                    $regex = '';
            
                    foreach($tokens as $token) {
            Severity: Minor
            Found in src/Route/Definition/Regex.php - About 1 hr 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

            Method create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static function create(string $name, array $args, callable $callback)
                {
                    $class = static::reflectionClass($name);
            
                    if (null === $class->constructor()) {
            Severity: Minor
            Found in src/Service/Builder.php - About 1 hr to fix

              Method tokens has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function tokens(string $path, array $constraints = []) : array
                  {
                      $currentPos = 0;
                      $length     = strlen($path);
                      $level      = 0;
              Severity: Minor
              Found in src/Route/Definition/Tokens.php - About 1 hr to fix

                Function tokens has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function tokens(string $path, array $constraints = []) : array
                    {
                        $currentPos = 0;
                        $length     = strlen($path);
                        $level      = 0;
                Severity: Minor
                Found in src/Route/Definition/Tokens.php - About 1 hr 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

                Method hydrate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function hydrate(Plugin $plugin, $service)
                    {
                        foreach($plugin->calls() as $method => $args) {
                            if (is_string($method)) {
                                if (INDEX == $method[0]) {
                Severity: Minor
                Found in src/Resolver/Resolver.php - About 1 hr to fix

                  Method errorException has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          string $message = '', int $code = 0, int $severity = E_ERROR,
                          string $file = __FILE__, int $line = __LINE__, \Throwable $previous = null, int $offset = 2
                  Severity: Major
                  Found in src/Exception/Generator.php - About 50 mins to fix

                    Method match has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        protected function match(Route $route, Request $request, string $path, int $offset, callable $next)
                    Severity: Minor
                    Found in src/Route/Match/Path.php - About 35 mins to fix

                      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function __construct(string $name = null, array $args = [], array $calls = [], string $param = null, bool $merge = false)
                      Severity: Minor
                      Found in src/Plugin/Plugin.php - About 35 mins to fix

                        Method repeat has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            protected function repeat($plugin, string $method, array $name = [], array $args = [], callable $callback = null)
                        Severity: Minor
                        Found in src/Resolver/Service.php - About 35 mins to fix

                          Method iterate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              protected function iterate($result, $event, Iterator $iterator, array $args, callable $callback = null)
                          Severity: Minor
                          Found in src/Event/Generator.php - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language