Showing 38 of 38 total issues
Method save
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save($model)
{
if (is_array($model)) {
$models = $model;
} elseif ($model instanceof Traversable) {
Method getSalesforcePropertiesFromReflectionClass
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSalesforcePropertiesFromReflectionClass(ReflectionClass $reflClass)
{
$salesforceProperties = array(
'object' => null,
'relations' => array(),
Function getQueryWherePart
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getQueryWherePart(array $criteria, $model)
{
$whereParts = array();
$object = $this->annotationReader->getSalesforceObject($model);
$fields = $this->annotationReader->getSalesforceFields($model);
- 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 getQueryWherePart
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getQueryWherePart(array $criteria, $model)
{
$whereParts = array();
$object = $this->annotationReader->getSalesforceObject($model);
$fields = $this->annotationReader->getSalesforceFields($model);
Method mapToDomainObject
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapToDomainObject($sObject, $modelClass)
{
// Try to find mapped model in unit of work
if ($this->unitOfWork->find($modelClass, $sObject->Id)) {
return $this->unitOfWork->find($modelClass, $sObject->Id);
Method getQuotedWhereValue
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getQuotedWhereValue(
Annotation\Field $field,
$value,
Result\DescribeSObjectResult $description
) {
Function mapToDomainObject
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function mapToDomainObject($sObject, $modelClass)
{
// Try to find mapped model in unit of work
if ($this->unitOfWork->find($modelClass, $sObject->Id)) {
return $this->unitOfWork->find($modelClass, $sObject->Id);
- 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 validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function validate($modelDirPath, string $wsdlPath): array
{
$this->modelDirPath = $modelDirPath;
$this->wsdlPath = $wsdlPath;
$missingFields = [];
- 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 getFields
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFields($modelClass, $includeRelatedLevels, $ignoreObject = null)
{
$fields = array();
foreach ($this->annotationReader->getSalesforceFields($modelClass) as $field) {
Function getSalesforcePropertiesFromReflectionClass
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getSalesforcePropertiesFromReflectionClass(ReflectionClass $reflClass)
{
$salesforceProperties = array(
'object' => null,
'relations' => 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 findBy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$model,
array $criteria,
array $order = array(),
$related = 1,
$deleted = false,
Method findOneBy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$model,
array $criteria,
array $order = array(),
$related = 2,
$deleted = false
Function populatModelIds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function populatModelIds($results, $section)
{
/* @var SaveResult $relatedResult */
if (isset($this->bulkModels[$section])) {
foreach ($this->bulkModels[$section] as $key => $storedModel) {
- 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 getOneToManySubqueries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getOneToManySubqueries($model, $includeRelatedLevels)
{
$relations = $this->annotationReader->getSalesforceRelations($model);
$object = $this->annotationReader->getSalesforceObject($model);
$subqueries = 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
Avoid too many return
statements within this method. Open
return "'" . addslashes($value) . "'";
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return $value ? 'true' : 'false';
Function getQuotedWhereValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getQuotedWhereValue(
Annotation\Field $field,
$value,
Result\DescribeSObjectResult $description
) {
- 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"