Showing 8 of 8 total issues
Function sendRequest
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function sendRequest(
RequestInterface $request,
ProxyInterface $proxy = null,
CookieJarInterface $cookieJar = null
) {
- 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
Method sendRequest
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendRequest(
RequestInterface $request,
ProxyInterface $proxy = null,
CookieJarInterface $cookieJar = null
) {
Method buildResponse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function buildResponse(
$rawResponse,
$headerSize,
UrlArchive $initialUrl,
UrlArchive $effectiveUrl,
Method createRequestOptions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createRequestOptions(RequestInterface $request)
{
// DEFAULT
$options = $this->options;
$options[CURLOPT_HEADER] = true;
Function parseHeaders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function parseHeaders(array $headers, &$data)
{
$statusLine = trim(array_shift($headers));
$parts = explode(' ', $statusLine, 3);
- 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 createRequestOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function createRequestOptions(RequestInterface $request)
{
// DEFAULT
$options = $this->options;
$options[CURLOPT_HEADER] = true;
- 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
Method buildResponse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$rawResponse,
$headerSize,
UrlArchive $initialUrl,
UrlArchive $effectiveUrl,
ProxyInterface $proxy = null
Function parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function parse($fileData)
{
$cookies = [];
$fileData = preg_split('/$\R?^/m', $fileData);
- 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"