Showing 693 of 740 total issues
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"
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 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 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 syncIndexes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function syncIndexes(Table $archiveTable, array $indexes, bool $rename)
{
foreach ($indexes as $index) {
$copiedIndex = clone $index;
if ($rename) {
- 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 getParametersFromColumnName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getParametersFromColumnName(?string $columnName = null): array
{
$array = [];
if ($columnName !== null) {
$this->cleanupParameters();
- 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 validateColumnParameter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function validateColumnParameter(): void
{
$columnParameters = $this->getParameter(static::PARAMETER_KEY_COLUMNS);
if (!$columnParameters) {
$this->throwInvalidArgumentExceptionWithLocation('At least one column is required');
- 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 getColumnSize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getColumnSize(string $name, bool $caseInsensitive = false): ?int
{
if ($caseInsensitive) {
foreach ($this->columnsSize as $forName => $size) {
if (strcasecmp($forName, $name) === 0) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function removeParametersFromColumnName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function removeParametersFromColumnName(?string $columnName = null): void
{
if ($columnName !== null) {
$newParams = [];
$parameters = $this->getParameters();
- 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 addAddVersion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addAddVersion(string &$script): void
{
$versionTable = $this->behavior->getVersionTable();
$versionARClassName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($versionTable));
- 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 addDatabase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addDatabase($database): Database
{
if ($database instanceof Database) {
$platform = null;
$database->setParentSchema($this);
- 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 syncUniqueIndexes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function syncUniqueIndexes(Table $archiveTable, array $uniqueIndexes)
{
foreach ($uniqueIndexes as $unique) {
$index = new Index();
$index->setTable($archiveTable);
- 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 getDatabase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDatabase(?string $name = null, bool $doFinalInitialization = true): ?Database
{
// this is temporary until we'll have a clean solution
// for packaging datamodels/requiring schemas
if ($doFinalInitialization) {
- 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"