Showing 693 of 740 total issues
Method addSequences
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addSequences(Database $database): void
{
$searchPath = '?';
$params = [$database->getSchema()];
if (!$database->getSchema()) {
Method addDeleteBody
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDeleteBody(string &$script): void
{
$script .= "
if (\$this->isDeleted()) {
throw new PropelException(\"This object has already been deleted.\");
Method normalizeTable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalizeTable(Table $table): void
{
if ($table->getPrimaryKey()) {
//search if there is already a UNIQUE constraint over the primary keys
$pkUniqueExist = false;
Function appendPsForUniqueClauseTo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function appendPsForUniqueClauseTo(string &$sb, array &$params): void
{
$field = ($this->table === null) ? $this->column : $this->table . '.' . $this->column;
$db = $this->getAdapter();
// If selection is case insensitive use ILIKE for PostgreSQL or SQL
- 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 addPrimaryKey
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addPrimaryKey(Table $table, int $oid): void
{
$stmt = $this->dbh->prepare("SELECT
DISTINCT ON(cls.relname)
cls.relname as idxname,
- 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 executeRollbackForDatasource
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function executeRollbackForDatasource(string $datasource, string $sql): void
{
$connection = $this->migrationManager->getConnection($datasource);
if ($this->isVerbose()) {
- 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 setAttribute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function setAttribute($attribute, $value): bool
{
if (is_string($attribute)) {
if (strpos($attribute, '::') === false) {
if (defined('\PDO::' . $attribute)) {
- 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 addCrossFKDoAdd
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKDoAdd(string &$script, CrossForeignKeys $crossFKs): void
{
$selfRelationNamePlural = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), true);
$relatedObjectClassName = $this->getCrossFKsPhpNameAffix($crossFKs, false);
$className = $this->getClassNameFromTable($crossFKs->getIncomingForeignKey()->getTable());
- 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 addCrossFKInit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKInit(string &$script, CrossForeignKeys $crossFKs): void
{
$inits = [];
if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
- 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 addEnsureConsistency
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addEnsureConsistency(string &$script): void
{
$table = $this->getTable();
$script .= "
- 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 addCrossFKGet
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKGet(string &$script, CrossForeignKeys $crossFKs): void
{
$refFK = $crossFKs->getIncomingForeignKey();
$selfRelationName = $this->getFKPhpNameAffix($refFK, false);
$crossRefTableName = $crossFKs->getMiddleTable()->getName();
- 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 addSaveBody
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addSaveBody(string &$script): void
{
$table = $this->getTable();
$reloadOnUpdate = $table->isReloadOnUpdate();
$reloadOnInsert = $table->isReloadOnInsert();
- 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 includeExternalSchemas
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function includeExternalSchemas(DOMDocument $dom, string $srcDir): int
{
$databaseNode = $dom->getElementsByTagName('database')->item(0);
$externalSchemaNodes = $dom->getElementsByTagName('external-schema');
- 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 getUsingCast
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getUsingCast(Column $fromColumn, Column $toColumn): string
{
$fromSqlType = strtoupper($fromColumn->getDomain()->getSqlType());
$toSqlType = strtoupper($toColumn->getDomain()->getSqlType());
$name = $fromColumn->getName();
- 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 getAddTableDDL
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getAddTableDDL(Table $table): string
{
$table = clone $table;
$tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
- 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 getSharedFks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function getSharedFks(Column $fromColumn, Column $toColumn): array
{
$sharedKeys = [];
foreach (['getReferrers', 'getForeignKeys'] as $getFk) {
- 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 buildJoinCondition
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildJoinCondition(Criteria $c): void
{
/** @var \Propel\Runtime\ActiveQuery\Criterion\AbstractCriterion|null $joinCondition */
$joinCondition = null;
for ($i = 0; $i < $this->count; $i++) {
Method addJoin
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addJoin($left, $right, ?string $joinType = null)
{
if (is_array($left) && is_array($right)) {
$conditions = [];
foreach ($left as $key => $value) {
Method convertDOMElementToArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertDOMElementToArray(DOMNode $data): array
{
$array = [];
$elementNames = [];
/** @var \DOMElement $element */
Method arrayToDOM
has 31 lines of code (exceeds 25 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;