venta/framework

View on GitHub

Showing 24 of 24 total issues

Route has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class Route implements RouteContract
{
    /**
     * @var string
     */
Severity: Minor
Found in src/Routing/src/Route.php - About 3 hrs to fix

    Function normalizeCallable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        private function normalizeCallable($callable)
        {
            if (is_object($callable)) {
                if ($callable instanceof Closure) {
                    return $callable;
    Severity: Minor
    Found in src/Container/src/Invokable.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 compilePath has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function compilePath(array $variables = []): string
        {
            $path = $this->path();
            foreach ($variables as $key => $value) {
                $pattern = sprintf('~%s~x', sprintf('\{\s*%s\s*(?::\s*([^{}]*(?:\{(?-1)\}[^{}]*)*))?\}', preg_quote($key)));
    Severity: Minor
    Found in src/Routing/src/Route.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 compilePath has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function compilePath(array $variables = []): string
        {
            $path = $this->path();
            foreach ($variables as $key => $value) {
                $pattern = sprintf('~%s~x', sprintf('\{\s*%s\s*(?::\s*([^{}]*(?:\{(?-1)\}[^{}]*)*))?\}', preg_quote($key)));
    Severity: Minor
    Found in src/Routing/src/Route.php - About 1 hr to fix

      Function parseParameters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function parseParameters(): array
          {
              $arguments = [];
              $options = [];
              $signatureArguments = $this->getParameters();
      Severity: Minor
      Found in src/Console/src/Command/SignatureParser.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 bind has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function bind(MutableContainer $container)
          {
              $container->bind(CacheContract::class, Cache::class);
              /** @var Config $config */
              $config = $container->get(Config::class);
      Severity: Minor
      Found in src/Framework/ServiceProvider/CacheServiceProvider.php - About 1 hr to fix

        Method __toString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __toString()
            {
                $attributes = [];
                $name = urlencode($this->name);
                if ((string)$this->value === '') {
        Severity: Minor
        Found in src/Http/src/Cookie.php - About 1 hr to fix

          Method parseParameters has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function parseParameters(): array
              {
                  $arguments = [];
                  $options = [];
                  $signatureArguments = $this->getParameters();
          Severity: Minor
          Found in src/Console/src/Command/SignatureParser.php - About 1 hr to fix

            Function apply has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function apply($object)
                {
                    foreach ($this->inflections as $type => $methods) {
                        if (!$object instanceof $type) {
                            continue;
            Severity: Minor
            Found in src/Container/src/ServiceInflector.php - About 55 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

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

                    string $name,
                    string $value,
                    $expiration,
                    string $path = '',
                    string $domain = '',
            Severity: Major
            Found in src/Contracts/src/Http/CookieJar.php - About 50 mins to fix

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

                      string $name,
                      string $value = '',
                      DateTimeInterface $expiration = null,
                      string $path = '',
                      string $domain = '',
              Severity: Major
              Found in src/Http/src/Cookie.php - About 50 mins to fix

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

                        string $name,
                        string $value,
                        $expiration,
                        string $path = '',
                        string $domain = '',
                Severity: Major
                Found in src/Http/src/CookieJar.php - About 50 mins to fix

                  Method forever has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          string $name,
                          string $value = null,
                          string $path = '',
                          string $domain = '',
                          bool $secure = false,
                  Severity: Minor
                  Found in src/Http/src/CookieJar.php - About 45 mins to fix

                    Method session has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            string $name,
                            string $value,
                            string $path = '',
                            string $domain = '',
                            bool $secure = false,
                    Severity: Minor
                    Found in src/Http/src/CookieJar.php - About 45 mins to fix

                      Function __toString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function __toString()
                          {
                              $attributes = [];
                              $name = urlencode($this->name);
                              if ((string)$this->value === '') {
                      Severity: Minor
                      Found in src/Http/src/Cookie.php - About 45 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

                      Method forever has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              string $name,
                              string $value,
                              string $path = '',
                              string $domain = '',
                              bool $secure = false,
                      Severity: Minor
                      Found in src/Contracts/src/Http/CookieJar.php - About 45 mins to fix

                        Function bind has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function bind(MutableContainer $container)
                            {
                                $container->bind(CacheContract::class, Cache::class);
                                /** @var Config $config */
                                $config = $container->get(Config::class);
                        Severity: Minor
                        Found in src/Framework/ServiceProvider/CacheServiceProvider.php - About 45 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

                        Method session has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                string $name,
                                string $value,
                                string $path = '',
                                string $domain = '',
                                bool $secure = false,
                        Severity: Minor
                        Found in src/Contracts/src/Http/CookieJar.php - About 45 mins to fix

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

                                  RouteDispatcherFactoryContract $dispatcherFactory,
                                  RouteMatcherContract $matcher,
                                  MiddlewarePipelineFactoryContract $pipelineFactory,
                                  RouteCollectionContract $routes,
                                  RequestRouteCollectionFactory $routeCollectionFactory
                          Severity: Minor
                          Found in src/Routing/src/Router.php - About 35 mins to fix

                            Function all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function all(): array
                                {
                                    $routes = [];
                                    /** @var Route $route */
                                    foreach (parent::all() as $route) {
                            Severity: Minor
                            Found in src/Routing/src/RouteGroup.php - About 35 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