File CURL.php
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace atmonshi\sender\STag;
class CURL
CURL
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class CURL
{
const VERSION = '2.1.0';
private $cookies = [];
Function get
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function get($url_mixed, $data = [])
{
if (is_array($url_mixed)) {
$curl_multi = curl_multi_init();
$this->multi_parent = 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
Function parseResponse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function parseResponse($response)
{
$response_headers = '';
$raw_response = $response;
if (!(strpos($response, "\r\n\r\n") === false)) {
- 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 postfields
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function postfields($data)
{
if (is_array($data)) {
if (self::is_array_multidim($data)) {
$data = self::http_build_multi_query($data);
- 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 get
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get($url_mixed, $data = [])
{
if (is_array($url_mixed)) {
$curl_multi = curl_multi_init();
$this->multi_parent = true;
Method parseResponse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseResponse($response)
{
$response_headers = '';
$raw_response = $response;
if (!(strpos($response, "\r\n\r\n") === false)) {
Method exec
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function exec($_ch = null)
{
$ch = $_ch === null ? $this : $_ch;
if ($ch->multi_child) {
Function exec
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function exec($_ch = null)
{
$ch = $_ch === null ? $this : $_ch;
if ($ch->multi_child) {
- 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 http_build_multi_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function http_build_multi_query($data, $key = null)
{
$query = [];
if (empty($data)) {
- 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"