File ObjectBuilder.php
has 4082 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
ObjectBuilder
has 209 functions (exceeds 20 allowed). Consider refactoring. Open
class ObjectBuilder extends AbstractObjectBuilder
{
/**
* Returns the package for the base object classes.
*
Method addCrossFKGet
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKGet(string &$script, CrossForeignKeys $crossFKs): void
{
$refFK = $crossFKs->getIncomingForeignKey();
$selfRelationName = $this->getFKPhpNameAffix($refFK, false);
$crossRefTableName = $crossFKs->getMiddleTable()->getName();
Method addCrossFkScheduledForDeletion
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFkScheduledForDeletion(string &$script, CrossForeignKeys $crossFKs): void
{
$multipleFks = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$crossFKs->getUnclassifiedPrimaryKeys();
$scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
$queryClassName = $this->getNewStubQueryBuilder($crossFKs->getMiddleTable())->getClassname();
Method addDoInsertBodyRaw
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoInsertBodyRaw(): string
{
$this->declareClasses(
'\Propel\Runtime\Propel',
'\PDO',
Function addHydrateBody
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected function addHydrateBody(string &$script): void
{
$table = $this->getTable();
$platform = $this->getPlatform();
- 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 addDoSave
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoSave(string &$script): void
{
$table = $this->getTable();
$reloadOnUpdate = $table->isReloadOnUpdate();
Function addDoInsertBodyRaw
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function addDoInsertBodyRaw(): string
{
$this->declareClasses(
'\Propel\Runtime\Propel',
'\PDO',
- 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 addHydrateBody
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHydrateBody(string &$script): void
{
$table = $this->getTable();
$platform = $this->getPlatform();
Method addSaveBody
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addSaveBody(string &$script): void
{
$table = $this->getTable();
$reloadOnUpdate = $table->isReloadOnUpdate();
$reloadOnInsert = $table->isReloadOnInsert();
Function addCrossFkScheduledForDeletion
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFkScheduledForDeletion(string &$script, CrossForeignKeys $crossFKs): void
{
$multipleFks = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$crossFKs->getUnclassifiedPrimaryKeys();
$scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
$queryClassName = $this->getNewStubQueryBuilder($crossFKs->getMiddleTable())->getClassname();
- 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 addClassBody
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addClassBody(string &$script): void
{
$this->declareClassFromBuilder($this->getStubObjectBuilder());
$this->declareClassFromBuilder($this->getStubQueryBuilder());
$this->declareClassFromBuilder($this->getTableMapBuilder());
Method addToArray
has 72 lines of code (exceeds 25 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;
Method addCrossFKDoAdd
has 65 lines of code (exceeds 25 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());
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
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 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();
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
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 addReload
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addReload(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
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));
Function addDoInsertBodyWithIdMethod
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function addDoInsertBodyWithIdMethod(): string
{
$table = $this->getTable();
$script = '';
foreach ($table->getPrimaryKey() 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
Method addCopyInto
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCopyInto(string &$script): void
{
$table = $this->getTable();
$script .= "
Method addCrossFKInit
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKInit(string &$script, CrossForeignKeys $crossFKs): void
{
$inits = [];
if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
Method addClearAllReferences
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addClearAllReferences(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Function getDefaultValueString
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function getDefaultValueString(Column $column): string
{
$defaultValue = var_export(null, true);
$val = $column->getPhpDefaultValue();
if ($val === null) {
- 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 addFKAccessor
has a Cognitive Complexity of 16 (exceeds 5 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();
- 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 addFKMutator
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFKMutator(string &$script, ForeignKey $fk): void
{
$fkTable = $fk->getForeignTable();
$interface = $fk->getInterface();
Method addCrossFKCreateQuery
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKCreateQuery(string &$script, CrossForeignKeys $crossFKs): void
{
if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
return;
}
Method addCrossFKSet
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKSet(string &$script, CrossForeignKeys $crossFKs): void
{
$scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
$multi = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$crossFKs->getUnclassifiedPrimaryKeys();
Method addRefFKGet
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKGet(string &$script, ForeignKey $refFK): void
{
$fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
$relCol = $this->getRefFKPhpNameAffix($refFK, true);
$collName = $this->getRefFKCollVarName($refFK);
Function addClassBody
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function addClassBody(string &$script): void
{
$this->declareClassFromBuilder($this->getStubObjectBuilder());
$this->declareClassFromBuilder($this->getStubQueryBuilder());
$this->declareClassFromBuilder($this->getTableMapBuilder());
- 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 addSetByPosition
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addSetByPosition(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method addClear
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addClear(string &$script): void
{
$table = $this->getTable();
$script .= "
Function addCopyInto
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function addCopyInto(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
Method addHashCode
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHashCode(string &$script): void
{
$script .= "
/**
* If the primary key is not null, return the hashcode of the
Method addMutatorCloseBody
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addMutatorCloseBody(string &$script, Column $column): void
{
$table = $this->getTable();
if ($column->isForeignKey()) {
Method addDoInsertBodyWithIdMethod
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoInsertBodyWithIdMethod(): string
{
$table = $this->getTable();
$script = '';
foreach ($table->getPrimaryKey() as $col) {
Method getDefaultValueString
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getDefaultValueString(Column $column): string
{
$defaultValue = var_export(null, true);
$val = $column->getPhpDefaultValue();
if ($val === null) {
Method addTemporalMutator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addTemporalMutator(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$dateTimeClass = $this->getDateTimeClass($col);
Method addRefFKRemove
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKRemove(string &$script, ForeignKey $refFK): void
{
$tblFK = $refFK->getTable();
$className = $this->getClassNameFromTable($refFK->getTable());
Method addRefFKSet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKSet(string &$script, ForeignKey $refFK): void
{
$relatedName = $this->getRefFKPhpNameAffix($refFK, true);
$relatedObjectClassName = $this->getRefFKPhpNameAffix($refFK, false);
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.\");
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 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 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 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 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
Method addRefFKGetJoinMethods
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKGetJoinMethods(string &$script, ForeignKey $refFK): void
{
$table = $this->getTable();
$tblFK = $refFK->getTable();
$joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
Method addCrossFKAdd
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKAdd(string &$script, CrossForeignKeys $crossFKs): void
{
$refFK = $crossFKs->getIncomingForeignKey();
foreach ($crossFKs->getCrossForeignKeys() as $crossFK) {
Function addClearAllReferences
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function addClearAllReferences(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 getCrossRefFKRemoveObjectNames
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getCrossRefFKRemoveObjectNames(CrossForeignKeys $crossFKs, ForeignKey $excludeFK): string
{
$names = [];
$fks = $crossFKs->getCrossForeignKeys();
- 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 addClear
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function addClear(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
Method addRefFKCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKCount(string &$script, ForeignKey $refFK): void
{
$fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
$relCol = $this->getRefFKPhpNameAffix($refFK, true);
$collName = $this->getRefFKCollVarName($refFK);
Method addRemoveArrayElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRemoveArrayElement(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$cfc = $col->getPhpName();
$visibility = $col->getAccessorVisibility();
Method addCrossFKIsLoaded
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKIsLoaded(string &$script, CrossForeignKeys $crossFKs): void
{
$inits = [];
if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
Method addHasOnlyDefaultValuesBody
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHasOnlyDefaultValuesBody(string &$script): void
{
$table = $this->getTable();
$colsWithDefaults = [];
foreach ($table->getColumns() as $col) {
Function addLazyLoaderBody
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addLazyLoaderBody(string &$script, Column $column): void
{
$platform = $this->getPlatform();
$clo = $column->getLowercasedName();
- 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 addHasOnlyDefaultValuesBody
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addHasOnlyDefaultValuesBody(string &$script): void
{
$table = $this->getTable();
$colsWithDefaults = [];
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 addReload
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addReload(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 addApplyDefaultValuesBody
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addApplyDefaultValuesBody(string &$script): void
{
$table = $this->getTable();
// FIXME - Apply support for PHP default expressions here
// see: http://propel.phpdb.org/trac/ticket/378
- 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 addClassOpen
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addClassOpen(string &$script): void
{
$table = $this->getTable();
$tableName = $table->getName();
$tableDesc = $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 addColumnAttributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumnAttributes(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 addRefFKGetJoinMethods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addRefFKGetJoinMethods(string &$script, ForeignKey $refFK): void
{
$table = $this->getTable();
$tblFK = $refFK->getTable();
$joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
- 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 addCrossFKCreateQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKCreateQuery(string &$script, CrossForeignKeys $crossFKs): void
{
if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
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 addFKMutator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addFKMutator(string &$script, ForeignKey $fk): void
{
$fkTable = $fk->getForeignTable();
$interface = $fk->getInterface();
- 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 addCrossFKSet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKSet(string &$script, CrossForeignKeys $crossFKs): void
{
$scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
$multi = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$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 addHashCode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addHashCode(string &$script): void
{
$script .= "
/**
* If the primary key is not null, return the hashcode of the
- 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 addDoInsert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addDoInsert(): string
{
$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 addColumnAttributeComment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumnAttributeComment(string &$script, Column $column): void
{
if ($column->isTemporalType()) {
$cptype = $this->getDateTimeClass($column);
} 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 validateModel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function validateModel(): void
{
parent::validateModel();
$table = $this->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 addTemporalMutator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addTemporalMutator(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$dateTimeClass = $this->getDateTimeClass($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 addCrossFKIsLoaded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addCrossFKIsLoaded(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
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function addAddArrayElement(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$cfc = $col->getPhpName();
$visibility = $col->getAccessorVisibility();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 178.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function addRemoveArrayElement(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$cfc = $col->getPhpName();
$visibility = $col->getAccessorVisibility();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 178.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($this->getPlatform() instanceof MysqlPlatform) {
if (in_array($col->getType(), [PropelTypes::TIMESTAMP, PropelTypes::DATETIME], true)) {
$handleMysqlDate = true;
$mysqlInvalidDateString = '0000-00-00 00:00:00';
} elseif ($col->getType() === PropelTypes::DATE) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 99.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($this->getPlatform() instanceof MysqlPlatform) {
if (in_array($column->getType(), [PropelTypes::TIMESTAMP, PropelTypes::DATETIME], true)) {
$handleMysqlDate = true;
$mysqlInvalidDateString = '0000-00-00 00:00:00';
} elseif ($column->getType() === PropelTypes::DATE) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 99.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76