Showing 693 of 740 total issues
File ObjectCollection.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
Function arrayToDOM
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function arrayToDOM(array $array, DOMElement $rootElement, ?string $charset = null): DOMElement
{
foreach ($array as $key => $value) {
if (is_numeric($key)) {
$key = $rootElement->nodeName;
- 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 addForeignKeys
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addForeignKeys(Table $table): void
{
$database = $table->getDatabase();
/** @var \PDOStatement $stmt */
- 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 addColumnMutatorMethods
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumnMutatorMethods(string &$script): void
{
foreach ($this->getTable()->getColumns() as $col) {
if ($col->getType() === PropelTypes::OBJECT) {
$this->addObjectMutator($script, $col);
- 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 addMutatorCloseBody
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addMutatorCloseBody(string &$script, Column $column): void
{
$table = $this->getTable();
if ($column->isForeignKey()) {
- 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 addToArray
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addToArray(string &$script): void
{
$fks = $this->getTable()->getForeignKeys();
$referrers = $this->getTable()->getReferrers();
$hasFks = count($fks) > 0 || count($referrers) > 0;
- 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 __toString
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function __toString(): string
{
$tables = [];
foreach ($this->getTables() as $table) {
$columns = [];
- 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 compareForeignKeys
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function compareForeignKeys(bool $caseInsensitive = false): int
{
$fkDifferences = 0;
$fromTableFks = $this->getFromTable()->getForeignKeys();
$toTableFks = $this->getToTable()->getForeignKeys();
- 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 addMakeSlugUnique
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addMakeSlugUnique(string &$script): void
{
$script .= "
/**
Method parseTables
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTables(array &$tableWraps, Database $database, ?Table $filterTable = null): void
{
$params = [];
$sql = "
Method addCrossFKCount
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKCount(string &$script, CrossForeignKeys $crossFKs): void
{
$refFK = $crossFKs->getIncomingForeignKey();
$selfRelationName = $this->getFKPhpNameAffix($refFK, false);
Method addFixLevels
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFixLevels(string &$script): void
{
$objectClassName = $this->objectClassName;
$queryClassName = $this->queryClassName;
$tableMapClassName = $this->tableMapClassName;
File SluggableBehavior.php
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
File ArchivableBehavior.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
AbstractCriterion
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractCriterion
{
/**
* @var string
*/
Consider simplifying this complex logical expression. Open
if (
$this->offset === $criteria->getOffset()
&& $this->limit === $criteria->getLimit()
&& $this->ignoreCase === $criteria->isIgnoreCase()
&& $this->singleRecord === $criteria->isSingleRecord()
Method addCrossFKRemove
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKRemove(string &$script, CrossForeignKeys $crossFKs): void
{
$relCol = $this->getCrossFKsPhpNameAffix($crossFKs, true);
if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
$collName = 'combination' . ucfirst($this->getCrossFKsVarName($crossFKs));
Method addReload
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addReload(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method loadDataModels
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadDataModels(): void
{
$schemas = [];
$totalNbTables = 0;
$dataModelFiles = $this->getSchemas();
Function replaceNames
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function replaceNames(string &$sql): bool
{
$this->replacedColumns = [];
$this->currentAlias = '';
$this->foundMatch = 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"