Showing 113 of 452 total issues
Method factory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
final public static function factory($where, $classOrTablename = null, $schema = null, array $options = [], $singleResult = false)
Method format
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function format($key, $value, $seen = [], $collectionCount = 0, $exceptionThrown = false)
Function execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$pdo = $this->connection->connect();
// We are only allowed to execute each Query object once!
- 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 duplicate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function duplicate($cloneExternalProps = false, Model $newParent = null)
{
$clone = clone $this;
$clone->new = true;
$clone->delete = 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 __set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __set($var, $value)
{
// Cannot change data if it is locked (i.e. it is attached to a Model object)
if ($this->locked) {
throw new Exception\Model('MODEL_DATA:SET_WHEN_LOCKED', array($var, $value));
- 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 guessContext
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function guessContext($classOrTable)
{
// Return 'cached' result
if (isset(static::$contextCache[$classOrTable])) {
return static::$contextCache[$classOrTable];
- 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 addOnClauses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addOnClauses($clauses)
{
foreach ($clauses as $key => $value) {
if ($value instanceof QueryBuilder) {
$value = new InnerQuery($value);
- 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 addClauses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addClauses($clauses)
{
foreach ($clauses as $key => $value) {
if ($value instanceof QueryBuilder) {
$value = new InnerQuery($value);
- 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 makeMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function makeMessage($code, $data)
{
switch ($code) {
case 'NO_GENERATED_SCHEMA':
return 'NO_GENERATED_SCHEMA: Could not find a schema definition for namespace: ' . $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
Avoid too many return
statements within this method. Open
return ["DELETE FROM $table{$where}{$limit}", $this->data];
Avoid too many return
statements within this method. Open
return 'ERROR_DURING_MASS_ASSIGNMENT: During ->assignData(), the following exception occurred: ' . $e->makeMessage($e->code, $e->data);
Avoid too many return
statements within this method. Open
return new static($list);
Avoid too many return
statements within this method. Open
return static::groupJoinM2M($collection, $var, $where, $onlyCount);
Avoid too many return
statements within this method. Open
return $this->joinM2M($var, $where);
Avoid too many return
statements within this method. Open
return $value1 <= $value2;
Avoid too many return
statements within this method. Open
return 'NO_SUCH_SERVICE: Tried to access service "{$data}", but it has not yet been definied';
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return 'MODEL_DATA:UNEXPECTED_COLUMN_NAME: Property "'.$column.'" does not exist in the schema for this object ('.$model['table_name'].'). Please check the $model for this object, or look at $obj->var_dump()';
Avoid too many return
statements within this method. Open
return $this->joinM21($var);
Avoid too many return
statements within this method. Open
return 'MODEL_DATA:INCORRECT_MODEL_FOR_RELATIONSHIP: Property "'.$column.'" expected a Model relating to table "'.$expectedTable.'" but a Model for "'.$suppliedTable.'" was given instead.';