Showing 693 of 740 total issues
Function getReadConnection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getReadConnection(?AdapterInterface $adapter = null): ConnectionInterface
{
if ($this->writeConnection && $this->writeConnection->inTransaction()) {
return $this->writeConnection;
}
- 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 formatOne
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function formatOne(?DataFetcherInterface $dataFetcher = null): ?array
{
$this->checkInit();
$result = 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 addSequences
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addSequences(Database $database): void
{
$searchPath = '?';
$params = [$database->getSchema()];
if (!$database->getSchema()) {
- 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 addFindPk
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addFindPk(string &$script): void
{
$class = $this->getObjectClassName();
$tableMapClassName = $this->getTableMapClassName();
$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 addFilterByRefFk
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function addFilterByRefFk(string &$script, ForeignKey $fk): void
{
$this->declareClasses(
'\Propel\Runtime\Collection\ObjectCollection',
'\Propel\Runtime\Exception\PropelException',
- 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 getRelatedBySuffix
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function getRelatedBySuffix(ForeignKey $fk): string
{
$relCol = '';
foreach ($fk->getMapping() as $mapping) {
- 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 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 computeDiff
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function computeDiff(Column $fromColumn, Column $toColumn)
{
$changedProperties = self::compareColumns($fromColumn, $toColumn);
if ($changedProperties) {
if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) {
- 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 getNextTableBehavior
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getNextTableBehavior(): ?Behavior
{
// order the behaviors according to Behavior::$tableModificationOrder
$behaviors = [];
$nextBehavior = 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 getPrimaryKeyDDL
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getPrimaryKeyDDL(Table $table): string
{
if ($table->hasPrimaryKey()) {
$keys = $table->getPrimaryKey();
- 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 getAddColumnDDL
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getAddColumnDDL(Column $column): string
{
$pattern = "
ALTER TABLE %s ADD %s %s;
";
- 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 findMigrationClassNameSuffix
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findMigrationClassNameSuffix(int $timestamp): string
{
$suffix = '';
$path = $this->getWorkingDirectory();
if ($path && is_dir($path)) {
- 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 modifyDatabase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function modifyDatabase(): void
{
foreach ($this->getDatabase()->getTables() as $table) {
if ($table->hasBehavior($this->getId())) {
// don't add the same behavior twice
- 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 objectFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function objectFilter(string &$script): void
{
$p = new PhpParser($script, true);
$text = (string)$p->findMethod('toArray');
$matches = [];
- 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 queryMethods
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function queryMethods(QueryBuilder $builder): string
{
$script = '';
foreach ($this->delegates as $delegate => $type) {
- 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 modifyTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function modifyTable(): void
{
$table = $this->getTable();
if (!$table->hasColumn($this->getParameter('rank_column'))) {
- 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 objectFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function objectFilter(string &$script, AbstractOMBuilder $builder): void
{
if ($this->behavior->useScope()) {
if ($this->behavior->hasMultipleScopes()) {
foreach ($this->behavior->getScopes() as $idx => $scope) {
- 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 queryAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function queryAttributes(): string
{
$script = '';
$collations = '';
- 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"