Showing 693 of 740 total issues
File PropelTypes.php
has 275 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
Method setupReferrers
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupReferrers(bool $throwErrors = false): void
{
foreach ($this->foreignKeys as $foreignKey) {
// table referrers
$foreignTable = $this->database->getTable($foreignKey->getForeignTableName());
Function search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function search($element)
{
$hashes = [];
$isActiveRecord = [];
foreach (func_get_args() as $pos => $obj) {
- 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 getColumnFromName
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function getColumnFromName(string $columnName, bool $failSilently = true): array
{
if (strpos($columnName, '.') === false) {
$prefix = (string)$this->getModelAliasOrName();
} else {
- 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 buildOrderByClause
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function buildOrderByClause(array &$params): array
{
$orderBy = $this->criteria->getOrderByColumns();
if (!$orderBy) {
return ['', ''];
- 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 addColumns
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
/** @var \PDOStatement $stmt */
$stmt = $this->dbh->query("SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, DATA_DEFAULT FROM USER_TAB_COLS WHERE TABLE_NAME = '" . $table->getName() . "'");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
- 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 addDoSave
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function addDoSave(string &$script): void
{
$table = $this->getTable();
$reloadOnUpdate = $table->isReloadOnUpdate();
- 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 addColumnAccessorMethods
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumnAccessorMethods(string &$script): void
{
$table = $this->getTable();
foreach ($table->getColumns() as $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 compareColumns
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function compareColumns(Column $fromColumn, Column $toColumn): array
{
$changedProperties = [];
// compare column types
- 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 compareColumns
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function compareColumns(bool $caseInsensitive = false): int
{
$fromTableColumns = $this->getFromTable()->getColumns();
$toTableColumns = $this->getToTable()->getColumns();
$columnDifferences = 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 addVersionTable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function addVersionTable(): void
{
$table = $this->getTable();
$database = $table->getDatabase();
$versionTableName = $this->getParameter('version_table') ?: ($table->getOriginCommonName() . '_version');
- 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 hydratePropelObjectCollection
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function &hydratePropelObjectCollection(array $row): array
{
$col = 0;
// hydrate main object or take it from registry
Method addFKAccessor
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFKAccessor(string &$script, ForeignKey $fk): void
{
$varName = $this->getFKVarName($fk);
$fkQueryBuilder = $this->getNewStubQueryBuilder($fk->getForeignTable());
$fkObjectBuilder = $this->getNewObjectBuilder($fk->getForeignTable())->getStubObjectBuilder();
Method getReverseDiff
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getReverseDiff(): self
{
$diff = new self();
// tables
CollectionIterator
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class CollectionIterator extends ArrayIterator implements IteratorInterface
{
/**
* @var \Propel\Runtime\Collection\Collection
*/
OraclePlatform
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class OraclePlatform extends DefaultPlatform
{
/**
* Initializes db specific domain mapping.
*
Method addColumns
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
$tableName = $table->getName();
/** @var \PDOStatement $stmt */
Method addLazyLoaderBody
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addLazyLoaderBody(string &$script, Column $column): void
{
$platform = $this->getPlatform();
$clo = $column->getLowercasedName();
Method addClassBody
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addClassBody(string &$script): void
{
$table = $this->getTable();
// namespaces
Method setupObject
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setupObject(): void
{
try {
$database = $this->getDatabase();
$platform = ($this->hasPlatform()) ? $this->getPlatform() : null;