Showing 33 of 72 total issues
Method createItem
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createItem(Item $item)
{
$payload = '';
$preparePayload = array(
"id" => $item->getId(),
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($jsonData)
{
if (count($jsonData)) {
$this->_itemName = array_key_exists('item_name', $jsonData)?$jsonData['item_name']:'';
$this->_fullAmount = array_key_exists('full_amount', $jsonData)?$jsonData['full_amount']:'';
Method requestSessionToken
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function requestSessionToken(Token $token)
{
$payload = '';
$preparePayload = array(
Method updateCompany
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateCompany(Company $company)
{
$payload='';
$preparePayload = array(
Function stripBom
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function stripBom($body)
{
if ( substr($body,0,3) === "\xef\xbb\xbf" ) // UTF-8
$body = substr($body,3);
else if ( substr($body,0,4) === "\xff\xfe\x00\x00" || substr($body,0,4) === "\x00\x00\xfe\xff" ) // UTF-32
- 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 buildUserAgent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function buildUserAgent()
{
$user_agent = 'User-Agent: Httpful/' . Httpful::VERSION . ' (cURL/';
$curl = \curl_version();
- 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 __call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __call($method, $args)
{
// This method supports the sends* methods
// like sendsJSON, sendsForm
//!method_exists($this, $method) &&
- 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 useProxy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function useProxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth_username = null, $auth_password = null, $proxy_type = Proxy::HTTP)
Method useSocks5Proxy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function useSocks5Proxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth_username = null, $auth_password = null)
Method useSocks4Proxy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function useSocks4Proxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth_username = null, $auth_password = null)
Function attach
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function attach($files)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
foreach ($files as $key => $file) {
$mimeType = finfo_file($finfo, $file);
- 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 send
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function send()
{
if (!$this->hasBeenInitialized())
$this->_curlPrep();
- 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 _serializePayload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function _serializePayload($payload)
{
if (empty($payload) || $this->serialize_payload_method === self::SERIALIZE_PAYLOAD_NEVER)
return $payload;
- 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"