Showing 452 of 452 total issues
Function getData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getData($table, $where, array $options = []) : array
{
// Select * from $table where $where
$query = QueryBuilder::select($table)->where($where);
- 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 joinCount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function joinCount($var, $where = [])
{
if (!is_null($this->external[$var]) && !$this->external[$var] instanceof Collection) {
return 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function render(QueryBuilder $query) : string
{
// Special case for tautological or contractdictory expressions (true / false)
if (!$this->column) {
return $this->comparitor;
- 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 commit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function commit($mode, $table, $id, $data, $externalData, $schema) : int
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
The closing brace for the interface must go on the next line after the body Open
}
- Exclude checks
Each PHP statement must be on a line by itself Open
return Data::groupJoin($this->map(function ($a) { return $a->getModel(); }), $parameter);
- Exclude checks
Expected 0 spaces before opening brace; 1 found Open
{
- Exclude checks
There must be one USE keyword per declaration Open
use Automatorm\Database\QueryBuilder\{
- Exclude checks
Property name "$_data" should not be prefixed with an underscore to indicate visibility Open
protected $_data; // Container for the Model_Data object for this row. Used for both internal and external __get access.
- Exclude checks
Method name "_init" should not be prefixed with an underscore to indicate visibility Open
protected function _init()
- Exclude checks
Property name "$_serviceContainer" should not be prefixed with an underscore to indicate visibility Open
protected $_serviceContainer = [];
- Exclude checks