Showing 228 of 247 total issues
Method getCreateAutoincrementSql
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getCreateAutoincrementSql(Table $table, Column $pkColumn): array
{
$sqls = [];
$pkSeqName = $this->getIdentitySequenceName($table->getName(), $pkColumn->getName());
- Create a ticketCreate a ticket
Method action
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function action(Model $model, string $type, array $args = [])
{
switch ($type) {
case 'select':
$action = $this->initAction($model, $args[0] ?? null);
- Create a ticketCreate a ticket
Method __construct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($field, $operator = null, $value = null)
{
if ($field instanceof AbstractScope) {
throw new Exception('Only Scope can contain another conditions');
} elseif ($field instanceof Field) { // for BC
- Create a ticketCreate a ticket
Method _renderConditionConditionalCastToText
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _renderConditionConditionalCastToText(string $sqlLeft, string $sqlRight, \Closure $makeSqlFx): string
{
return $this->_renderConditionBinaryReuse(
$sqlLeft,
$sqlRight,
- Create a ticketCreate a ticket
Method _render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _render(): array
{
// - [xxx] = param
// - {xxx} = escape
// - {{xxx}} = escapeSoft
- Create a ticketCreate a ticket
Function _renderConditionBinaryReuse
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _renderConditionBinaryReuse(
string $sqlLeft,
string $sqlRight,
\Closure $makeSqlFx,
bool $allowReuseLeft = true,
- 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 _renderCase
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _renderCase(): ?string
{
if (!isset($this->args['case_when'])) {
return null;
}
- 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 validateBeforeExecute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function validateBeforeExecute(): void
{
if ($this->enabled === false || ($this->enabled instanceof \Closure && ($this->enabled)($this->_getOwner()) === false)) {
throw new Exception('User action is disabled');
}
- 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 fieldToWords
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function fieldToWords(Model $model): string
{
$words = [];
$field = $this->field;
- 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
Method _load
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _load(bool $fromReload, bool $fromTryLoad, $id)
{
$this->getModel()->assertHasPersistence();
if ($this->isLoaded()) {
throw new Exception('Entity must be unloaded');
- Create a ticketCreate a ticket
Method tryLoad
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
public function tryLoad(Model $model, $id): ?array
{
$model->assertIsModel();
- Create a ticketCreate a ticket
Method createAnalysingTheirModel
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createAnalysingTheirModel(array $defaults = []): Model
{
if ((self::$analysingTheirModelMap ?? null) === null) {
self::$analysingTheirModelMap = new WeakAnalysingMap();
}
- Create a ticketCreate a ticket
Method join
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function join(
$foreignTable,
$masterField = null,
$joinKind = null,
$foreignAlias = null
- Create a ticketCreate a ticket
Method _addField
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _addField(string $fieldName, bool $theirFieldIsTitle, ?string $theirFieldName, array $defaults): SqlExpressionField
{
$ourModel = $this->getOurModel();
$fieldExpression = $ourModel->addExpression($fieldName, array_merge([
- Create a ticketCreate a ticket
Method updateRenderBeforeExecute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
protected function updateRenderBeforeExecute(array $render): array
{
[$sql, $params] = parent::updateRenderBeforeExecute($render);
- Create a ticketCreate a ticket
Method ref
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
public function ref(Model $ourModelOrEntity, array $defaults = []): Model
{
$this->assertOurModelOrEntity($ourModelOrEntity);
- Create a ticketCreate a ticket
Method getCreateAutoincrementSql
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
public function getCreateAutoincrementSql($name, $table, $start = 1)
{
$sqls = parent::getCreateAutoincrementSql($name, $table, $start);
- Create a ticketCreate a ticket
Method escapeStringLiteral
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
protected function escapeStringLiteral(string $value): string
{
// Oracle (multibyte) string literal is limited to 1332 bytes
$parts = $this->splitLongString($value, 1000);
- Create a ticketCreate a ticket
Method init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
protected function init(): void
{
parent::init();
- Create a ticketCreate a ticket
Function _initQueryConditions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function _initQueryConditions(Query $query, Model\Scope\AbstractScope $condition): void
{
if (!$condition->isEmpty()) {
// peel off the single nested scopes to convert (((field = value))) to field = value
$condition = $condition->simplify();
- 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"