Showing 221 of 222 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 658 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 531 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 527 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 52 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Query extends Expression
{
/** Template name for render. */
public string $mode = 'select';
- 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 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 _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 _subrenderCondition
has a Cognitive Complexity of 36 (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
File Migrator.php
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Schema;
- Create a ticketCreate a ticket
Function setDb
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function setDb(array $dbData, bool $importData = true): void
{
foreach ($dbData as $tableName => $data) {
$migrator = $this->createMigrator()->table($tableName);
- 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
Function _execute
has a Cognitive Complexity of 29 (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 TestCase.php
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Schema;
- Create a ticketCreate a ticket
File Persistence.php
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data;
- Create a ticketCreate a ticket
Join
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Join
{
use DiContainerTrait;
use InitializerTrait {
init as private _init;
- Create a ticketCreate a ticket