Showing 20 of 30 total issues
File SforceBaseClient.php
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace Davispeixoto\ForceDotComToolkitForPhp;
/*
* Copyright (c) 2007, salesforce.com, inc.
* All rights reserved.
Function __construct
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($response = null)
{
if (!isset($response) && !$response) {
return;
}
- 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 xml2array
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
public function xml2array($contents, $get_attributes = 1)
{
if (!$contents) {
return array();
}
- 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
SforceBaseClient
has 63 functions (exceeds 20 allowed). Consider refactoring. Open
class SforceBaseClient
{
protected $sforce;
protected $sessionId;
protected $location;
Function setHeaders
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function setHeaders($call = null)
{
$this->sforce->__setSoapHeaders(null);
$header_array = array(
- 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 setHeaders
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setHeaders($call = null)
{
$this->sforce->__setSoapHeaders(null);
$header_array = array(
Method xml2array
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function xml2array($contents, $get_attributes = 1)
{
if (!$contents) {
return array();
}
SforceCustomField
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class SforceCustomField
{
public function setCaseSensitive($caseSensitive)
{
$this->caseSensitive = $caseSensitive;
Method __construct
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($response = null)
{
if (!isset($response) && !$response) {
return;
}
Function __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($response)
{
if ($response instanceof SforceSearchResult) {
$this->searchRecords = $response->searchRecords;
} else {
- 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 __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($response)
{
$this->queryLocator = $response->queryLocator;
$this->done = $response->done;
$this->size = $response->size;
- 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 __construct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($wsdl, $loginResult, $sforceConn)
{
$soapClientArray = null;
$phpversion = substr(PHP_VERSION, 0, strpos(PHP_VERSION, '-'));
Function update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function update($sObjects, $type, $assignment_header = null, $mru_header = null)
{
$arg = new stdClass;
$arg->sObjects = [];
foreach ($sObjects as $sObject) {
- 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 upsert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function upsert($ext_Id, $sObjects, $type = 'Contact')
{
$arg = new stdClass;
$arg->sObjects = [];
$arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function create($sObjects, $type)
{
$arg = [];
foreach ($sObjects as $sObject) {
// FIX for fieldsToNull issue - allow array in fieldsToNull (STEP #1)
- 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 convertLead
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function convertLead($leadConverts)
{
$this->setHeaders("convertLead");
$arg = new stdClass();
- 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 valid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function valid()
{
while ($this->pointer >= count($this->records)) {
// Pointer is larger than (current) result set; see if we can fetch more
if ($this->done === 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
Consider simplifying this complex logical expression. Open
if ($call == "create" ||
$call == "merge" ||
$call == "query" ||
$call == "retrieve" ||
$call == "update" ||
Consider simplifying this complex logical expression. Open
if ((is_array($current[$tag]) && $get_attributes == 0)//If it is already an array...
|| (isset($current[$tag][0]) && is_array($current[$tag][0]) && ($get_attributes == 1 || $get_attributes == 2))
) {
array_push($current[$tag], $result); // ...push the new element into that array.
} else { //If it is not an array...
Method __doRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __doRequest($request, $location, $action, $version, $one_way = 0)