atelierspierrot/http-fundamental

View on GitHub

Showing 18 of 18 total issues

Request has 49 functions (exceeds 20 allowed). Consider refactoring.
Open

class Request
    implements RequestInterface
{

    /**
Severity: Minor
Found in src/HttpFundamental/Request.php - About 6 hrs to fix

    File Request.php has 397 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * This file is part of the HTTP Fundamental package.
     *
     * Copyright (c) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
    Severity: Minor
    Found in src/HttpFundamental/Request.php - About 5 hrs to fix

      Cookie has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Cookie
      {
          
          /**
           * Transform array values as flatten string (`serialize` like)
      Severity: Minor
      Found in src/HttpFundamental/Cookie.php - About 4 hrs to fix

        Response has 27 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Response
            implements ResponseInterface
        {
        
            /**
        Severity: Minor
        Found in src/HttpFundamental/Response.php - About 3 hrs to fix

          File Cookie.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * This file is part of the HTTP Fundamental package.
           *
           * Copyright (c) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
          Severity: Minor
          Found in src/HttpFundamental/Cookie.php - About 2 hrs to fix

            Function buildUrl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function buildUrl()
                {
                    $url = UrlHelper::parse($this->getUrl());
                    
                    $get = $this->getArguments();
            Severity: Minor
            Found in src/HttpFundamental/Request.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

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

                protected function _extractSegments(&$arguments)
                {
                    if (is_string($arguments)) {
                        $this->_extractArguments($arguments);
                    }
            Severity: Minor
            Found in src/HttpFundamental/Request.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 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $url = null, $flag = self::NO_REWRITE,
                    $protocol = 'http', $method = 'get', array $headers = null,
                    array $arguments = null, array $data = null,
                    array $session = null, array $files = null, array $cookies = null
            Severity: Major
            Found in src/HttpFundamental/Request.php - About 1 hr to fix

              Method buildUrl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function buildUrl()
                  {
                      $url = UrlHelper::parse($this->getUrl());
                      
                      $get = $this->getArguments();
              Severity: Minor
              Found in src/HttpFundamental/Request.php - About 1 hr to fix

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

                    public static function create(
                        $url = null, $flag = self::NO_REWRITE,
                        $protocol = 'http', $method = 'get', array $headers = null,
                        array $arguments = null, array $data = null,
                        array $session = null, array $files = null, array $cookies = null
                Severity: Minor
                Found in src/HttpFundamental/Request.php - About 1 hr to fix

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

                      public static function create(
                          $url = null, $flag = self::NO_REWRITE,
                          $protocol = 'http', $method = 'get', array $headers = null,
                          array $arguments = null, array $data = null,
                          array $session = null, array $files = null, array $cookies = null
                  Severity: Minor
                  Found in src/HttpFundamental/Request.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

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

                      public static function getallheaders()
                      {
                          if (function_exists('getallheaders')) {
                              $return = getallheaders();
                          } else {
                  Severity: Minor
                  Found in src/HttpFundamental/Request.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

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

                      public function send($cookie_name = null, $cookie_value = null)
                      {
                          if (!empty($cookie_name)) {
                              $this->setName($cookie_name);
                          }
                  Severity: Minor
                  Found in src/HttpFundamental/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 getArgument has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function getArgument($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8')
                  Severity: Minor
                  Found in src/HttpFundamental/Request.php - About 35 mins to fix

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

                        public function getData($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8')
                    Severity: Minor
                    Found in src/HttpFundamental/Request.php - About 35 mins to fix

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

                          public function loadClass($className)
                          {
                              if ($filePath = $this->resolveFileName($className)) {
                                  if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
                                      if ($this->classFileExists($filePath)) {
                      Severity: Minor
                      Found in src/SplClassLoader.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

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

                          protected function _organizeCookieFuncArguments()
                          {
                              $original_args = $this->_arguments;
                              $this->_arguments = array();
                              $missing_var = $missing_index = null;
                      Severity: Minor
                      Found in src/HttpFundamental/Cookie.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

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

                          public function prepareContent($content)
                          {
                              if (is_array($content)) {
                                  $ctt = '';
                                  foreach ($content as $key=>$ctt) {
                      Severity: Minor
                      Found in src/HttpFundamental/ContentType/PlainText.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