Goracash/goracash-api-php-client

View on GitHub
src/IO/Primary.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 3 of 3 total issues

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

private function parseStringHeaders($rawHeaders)
{
$headers = array();
$responseHeaderLines = explode("\r\n", $rawHeaders);
foreach ($responseHeaderLines as $headerLine) {
Severity: Minor
Found in src/IO/Primary.php - About 45 mins to fix

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

public function parseHttpResponse($respData, $headerSize)
{
// check proxy header
foreach (self::$connectionEstablishedHeaders as $establishedHeader) {
if (stripos($respData, $establishedHeader) !== false) {
Severity: Minor
Found in src/IO/Primary.php - About 45 mins to fix

Avoid excessively long variable names like $connectionEstablishedHeaders. Keep variable name length under 20.
Open

private static $connectionEstablishedHeaders = array(
"HTTP/1.0 200 Connection established\r\n\r\n",
"HTTP/1.1 200 Connection established\r\n\r\n",
);
Severity: Minor
Found in src/IO/Primary.php by phpmd

There are no issues that match your filters.

Category
Status