Showing 693 of 740 total issues
Function extractPrimaryKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function extractPrimaryKey(Criteria $criteria): ?array
{
$pkCols = $this->getPrimaryKeys();
if (count($pkCols) !== count($criteria->getMap())) {
return 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 updateDB
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateDB(ConnectionInterface $con): ?Database
{
$database = $this->readConnectedDatabase();
$diff = DatabaseComparator::computeDiff($database, $this->database);
- 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 addValueSetColumnAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addValueSetColumnAttributes(string &$script): void
{
$script .= "
/**
* The enumerated values for this table
- 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 addValueSetColumnConstants
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addValueSetColumnConstants(string &$script): void
{
foreach ($this->getTable()->getColumns() as $col) {
if ($col->isValueSetType()) {
$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 addAddSelectColumns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addAddSelectColumns(string &$script): void
{
$script .= "
/**
* Add all the columns needed to create a new object.
- 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 addRemoveSelectColumns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addRemoveSelectColumns(string &$script): void
{
$script .= "
/**
* Remove all the columns needed to create a new object.
- 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 buildDatabaseNameToTableMapDumps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function buildDatabaseNameToTableMapDumps(array $schemas): array
{
$entries = [];
foreach ($schemas as $schema) {
foreach ($schema->getDatabases(false) as $database) {
- 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
Function getCrossRefFKGetterName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getCrossRefFKGetterName(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 getProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getProperties(string $file): array
{
$properties = [];
$lines = @file($file);
- 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 getColumnDDL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getColumnDDL(Column $col): string
{
$domain = $col->getDomain();
$ddl = [$this->quoteIdentifier($col->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 getBuildConnections
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getBuildConnections(): array
{
if ($this->buildConnections !== null) {
return $this->buildConnections;
}
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public static function computeDiff(Index $fromIndex, Index $toIndex, bool $caseInsensitive = false): bool
{
// Check for removed index columns in $toIndex
$fromIndexColumns = $fromIndex->getColumns();
$max = count($fromIndexColumns);
- 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 getInstance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getInstance(string $className, $arguments = null, ?string $interfaceName = null): object
{
if (!class_exists($className)) {
throw new ClassNotFoundException("Class $className not found.");
}
- 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 getAutoIncrementPrimaryKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAutoIncrementPrimaryKey(): ?Column
{
if ($this->getIdMethod() !== IdMethod::NO_ID_METHOD) {
foreach ($this->getPrimaryKey() as $pk) {
if ($pk->isAutoIncrement()) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public static function computeDiff(ForeignKey $fromFk, ForeignKey $toFk, bool $caseInsensitive = false): bool
{
// Check for differences in local and remote table
$fromDifferentTable = $caseInsensitive ?
strtolower($fromFk->getTableName()) !== strtolower($toFk->getTableName()) :
- 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 addReference
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addReference($ref1, $ref2 = null): void
{
if (is_array($ref1)) {
$this->localColumns[] = $ref1['local'] ?? null;
$this->foreignColumns[] = $ref1['foreign'] ?? 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 buildSql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function buildSql(): void
{
$sqlDbMapContent = "# Sqlfile -> Database map\n";
foreach ($this->getDatabases() as $datasource => $database) {
/** @var \Propel\Generator\Platform\DefaultPlatform $platform */
- 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"