PHPixie/HTTP

View on GitHub

Showing 23 of 23 total issues

URI has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class URI implements UriInterface
{
    /**
     * @var string
     */
Severity: Minor
Found in src/PHPixie/HTTP/Messages/URI.php - About 3 hrs to fix

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

        protected function requireUploadedFiles()
        {
            if($this->uploadedFiles !== null) {
                return;
            }
    Severity: Minor
    Found in src/PHPixie/HTTP/Messages/Message/Request/ServerRequest/SAPI.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 __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $protocolVersion,
            $headers,
            $body,
            $method,
            $uri,

      Method serverRequest has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $protocolVersion,
              $headers,
              $body,
              $method,
              $uri,
      Severity: Major
      Found in src/PHPixie/HTTP/Messages.php - About 1 hr to fix

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

                $name,
                $value,
                $expires = null,
                $path = '/',
                $domain = null,
        Severity: Major
        Found in src/PHPixie/HTTP/Context/Cookies/Update.php - About 1 hr to fix

          Method set has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $name,
                  $value,
                  $lifetime = null,
                  $path = '/',
                  $domain = null,
          Severity: Major
          Found in src/PHPixie/HTTP/Context/Cookies.php - About 1 hr to fix

            Method cookiesUpdate has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $name,
                    $value,
                    $expires = null,
                    $path = '/',
                    $domain = null,
            Severity: Major
            Found in src/PHPixie/HTTP/Builder.php - About 1 hr to fix

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

                  protected function mergeContextHeaders($context)
                  {
                      $headers = $this->headers->asArray();
                      
                      if($context === null ) {
              Severity: Minor
              Found in src/PHPixie/HTTP/Responses/Response.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 __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct($messages, $server, $get, $post, $cookies, $files, $attributes = array())
              Severity: Major
              Found in src/PHPixie/HTTP/Messages/Message/Request/ServerRequest/SAPI.php - About 50 mins to fix

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

                        $messages,
                        $file,
                        $clientFilename = null,
                        $clientMediaType = null,
                        $size = null,
                Severity: Minor
                Found in src/PHPixie/HTTP/Messages/UploadedFile/Implementation.php - About 45 mins to fix

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

                          $server = null,
                          $get = null,
                          $post = null,
                          $cookie = null,
                          $files = null,
                  Severity: Minor
                  Found in src/PHPixie/HTTP/Messages.php - About 45 mins to fix

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

                        protected function requireHeaders()
                        {
                            if($this->processedHeaders) {
                                return;
                            }
                    Severity: Minor
                    Found in src/PHPixie/HTTP/Messages/Message/Request/ServerRequest/SAPI.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 response has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function response($protocolVersion, $headers, $body, $statusCode = 200, $reasonPhrase = null)
                    Severity: Minor
                    Found in src/PHPixie/HTTP/Messages.php - About 35 mins to fix

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

                          public function request($protocolVersion, $headers, $body, $method, $uri)
                      Severity: Minor
                      Found in src/PHPixie/HTTP/Messages.php - About 35 mins to fix

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

                            public function __construct($protocolVersion, $headers, $body, $statusCode = 200, $reasonPhrase = null)
                        Severity: Minor
                        Found in src/PHPixie/HTTP/Messages/Message/Response.php - About 35 mins to fix

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

                              public function __construct($messages, $headers, $body, $statusCode = 200, $reasonPhrase = null)
                          Severity: Minor
                          Found in src/PHPixie/HTTP/Responses/Response.php - About 35 mins to fix

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

                                    $file,
                                    $clientFilename = null,
                                    $clientMediaType = null,
                                    $size = null,
                                    $error = UPLOAD_ERR_OK
                            Severity: Minor
                            Found in src/PHPixie/HTTP/Messages.php - About 35 mins to fix

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

                                  public function __construct($protocolVersion, $headers, $body, $method, $uri)
                              Severity: Minor
                              Found in src/PHPixie/HTTP/Messages/Message/Request/Implementation.php - About 35 mins to fix

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

                                    protected function modifyHeader($header, $value, $append = false, $clone = true)
                                    {
                                        $this->requireHeaders();
                                        if (!is_array($value)) {
                                            $value = array($value);
                                Severity: Minor
                                Found in src/PHPixie/HTTP/Messages/Message.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 __toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function __toString()
                                    {
                                        if ($this->uriString === null) {
                                
                                            $uri = '';
                                Severity: Minor
                                Found in src/PHPixie/HTTP/Messages/URI.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