Showing 113 of 452 total issues
Method generateData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateData($connection)
{
list($schema, $database) = $connection->getSchemaGenerator()->generate();
$currentTable = null;
Method groupJoinM2M
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function groupJoinM2M(Collection $collection, $var, $where, $countOnly = false)
{
$results = new Collection();
$proto = $collection[0]->_data;
Method resolve
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolve() : array
{
$this->data = [];
$table = $this->table->render($this);
Method commit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit()
{
// Determine the type of SQL instruction to run
if ($this->delete) {
$mode = 'delete';
Method factoryObjectCache
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public static function factoryObjectCache($ids, $classOrTable = null, Schema $schema = null, $forceRefresh = false)
{
$schema = $schema ?: Schema::get(static::getNamespace());
list(,$table) = $schema->guessContext($classOrTable ?: get_called_class());
$namespace = $schema->namespace;
Method getFullTree
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFullTree()
{
$table = $this->closureTable;
// Find the root node from the supplied node_id
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$pdo = $this->connection->connect();
// We are only allowed to execute each Query object once!
Function __get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function &__get($var)
{
/* This property is a native database column, return it */
if (isset($this->data[$var])) {
return $this->data[$var];
- 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 dataClearCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
final public function dataClearCache()
{
$modelschema = $this->_data->getModel();
// Clean out cached column 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
Method __call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call($name, $args)
{
// If we use Model::COUNT_ONLY on empty container, return 0
if (count($this->container) == 0 && is_numeric($args[1]) && ($args[1] & Model::COUNT_ONLY)) {
return 0;
Method generateForeignKeys
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateForeignKeys(Data $datastore)
{
$data = $datastore->data;
$tableName = null;
$keys = [];
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 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
Method commit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function commit($mode, $table, $id, $data, $externalData, $schema) : int
Function generate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function generate(Connection $connection, $namespace = 'models', $cache = null) : Schema
{
// Get schema from cache
if (is_null($cache)) {
list($model, $schema) = $connection->getSchemaGenerator()->generate();
- 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 commit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function commit($mode, $table, $id, $data, $externalData, $schema) : int
Function join
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function join($var, array $where = [])
{
if (array_key_exists($var, $this->external)) {
if ($this->external[$var] instanceof Collection) {
return $this->external[$var]->filter($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 extractAffix
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function extractAffix($propertyName, $invert = false)
{
$parts = [];
// Look for special non-alphanumeric affixes
preg_match('/^([!=<>%#]*)([^!=<>%#]+)([!=<>%#]*)$/', $propertyName, $parts);
- 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"