Showing 14 of 16 total issues
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
string $method, $uri, string $version = '1.1', array $headers = [],
array $queryParams = [], $body = null,
array $serverParams = [], array $cookieParams = [],
array $files = [], array $attributes = []
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($xml, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $text, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($uri, int $statusCode = 302, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(array $data, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $html, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1')
Method createUploadedFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
StreamInterface $stream, ?int $size = null, int $error = UPLOAD_ERR_OK,
string $clientFilename = null, string $clientMediaType = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$streamOrFile, ?int $size, int $error,
string $clientFileName = null, string $clientMediaType = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
int $statusCode = 200, array $headers = [], $body = null,
string $version = '1.1', string $reason = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(int $offset, int $whence, $message = '', $code = 0, Throwable $previous = null)
Function buildPathByAuthority
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function buildPathByAuthority(string $path, string $authority): string
{
$newPath = $path;
if ('/' !== $path[0]) {
- Read upRead up
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 setHeaders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function setHeaders(array $headers): void
{
foreach ($headers as $header => $value) {
if (is_integer($header)) {
$header = (string) $header;
- Read upRead up
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(): array
{
$headers = [];
foreach ($this->serverParameters as $key => $value) {
if (!is_string($key) or $value === '') {
- Read upRead up
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"