Showing 246 of 247 total issues
Model
has 91 functions (exceeds 20 allowed). Consider refactoring. Open
class Model implements \IteratorAggregate
{
use CollectionTrait {
_addIntoCollection as private __addIntoCollection;
}
- Create a ticketCreate a ticket
File Query.php
has 731 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Persistence\Sql;
- Create a ticketCreate a ticket
File Sql.php
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Persistence;
- Create a ticketCreate a ticket
File Expression.php
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Persistence\Sql;
- Create a ticketCreate a ticket
Query
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Query extends Expression
{
private const FIELD_INT_STRING_PREFIX = "\xff_int-string_";
/** Template name for render. */
- Create a ticketCreate a ticket
Function __construct
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $data = [])
{
if (count($data) > 0 && !is_array(reset($data))) {
$dataOrig = $data;
$data = [];
- Read upRead up
- Create a ticketCreate a ticket
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 toQueryArguments
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function toQueryArguments(): array
{
$field = $this->field;
$operator = $this->operator;
$value = $this->value;
- Read upRead up
- Create a ticketCreate a ticket
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 setDb
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function setDb(array $dbData, bool $importData = true): void
{
foreach ($dbData as $tableName => $data) {
$idField = $data['_types']['_idField'] ?? 'id';
unset($data['_types']['_idField']);
- Read upRead up
- Create a ticketCreate a ticket
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
File Migrator.php
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Schema;
- Create a ticketCreate a ticket
Function compareExportUnorderedValue
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private static function compareExportUnorderedValue($a, $b): int
{
if ($a === $b) {
return 0;
}
- Read upRead up
- Create a ticketCreate a ticket
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 normalizeDsn
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function normalizeDsn($dsn, $user = null, $password = null)
{
// BC for 2.4 - 3.0 accepted DSN input
if (is_string($dsn)) {
$dsn = ['dsn' => $dsn];
- Read upRead up
- Create a ticketCreate a ticket
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 normalize
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function normalize($value)
{
try {
if ($this->issetOwner() && $this->getOwner()->hook(Model::HOOK_NORMALIZE, [$this, $value]) === false) {
return $value;
- Read upRead up
- Create a ticketCreate a ticket
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 export
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function export(?array $fields = null, ?string $keyField = null, bool $typecast = true): array
{
$this->assertHasPersistence('export');
// no key field - then just do export
- Read upRead up
- Create a ticketCreate a ticket
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 _subrenderCondition
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
protected function _subrenderCondition(array $row): string
{
if (count($row) === 1) {
[$field] = $row;
} elseif (count($row) === 3) {
- Read upRead up
- Create a ticketCreate a ticket
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 _copy
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function _copy(Model $source, Model $destination, array $references, array $exclusions, array $transforms): Model
{
try {
$sourceTable = $source->getModel()->table;
- Read upRead up
- Create a ticketCreate a ticket
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 _execute
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected function _execute(?object $connection, bool $fromExecuteStatement)
{
if ($connection === null) {
$connection = $this->connection;
}
- Read upRead up
- Create a ticketCreate a ticket
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
File Join.php
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Model;
- Create a ticketCreate a ticket
File Persistence.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data;
- Create a ticketCreate a ticket
Function _typecastPreField
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function _typecastPreField(Field $field, $value, bool $fromLoad)
{
if (is_string($value)) {
switch ($field->type) {
case 'boolean':
- Read upRead up
- Create a ticketCreate a ticket
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 ($matches[3] === 'BOOLEAN' && ($types[$k] === ParameterType::BOOLEAN || $types[$k] === ParameterType::INTEGER)
&& (is_bool($params[$k]) || $params[$k] === '0' || $params[$k] === '1')
) {
$types[$k] = ParameterType::BOOLEAN;
$params[$k] = (bool) $params[$k];
- Create a ticketCreate a ticket