Showing 740 of 740 total issues
Function addForeignKeys
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function addForeignKeys(Table $table, int $oid): void
{
$database = $table->getDatabase();
$stmt = $this->dbh->prepare("SELECT
conname,
- 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 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());
File ConnectionWrapper.php
has 308 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
Method getColumnFromRow
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnFromRow(array $row, Table $table): Column
{
$name = $row['Field'];
$isNullable = ($row['Null'] === 'YES');
$autoincrement = (strpos($row['Extra'], 'auto_increment') !== false);
Method addFindPkSimple
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFindPkSimple(string &$script): void
{
$table = $this->getTable();
// this method is not needed if the table has no primary key
RelationMap
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class RelationMap
{
// types
/**
* @var int
Domain
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Domain extends MappingModel
{
/**
* @var string|null
*/
Method execute
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$consoleHelper = new ConsoleHelper($input, $output);
$this->getHelperSet()->set($consoleHelper);
Method addPopulateFromVersion
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addPopulateFromVersion(string &$script): void
{
$ARclassName = $this->getActiveRecordClassName();
$versionTable = $this->behavior->getVersionTable();
$versionColumnName = $versionTable->getColumn($this->behavior->getParameter('version_column'))->getPhpName();
Function getCriterionForClause
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function getCriterionForClause(string $clause, $value, ?int $bindingType = null): AbstractCriterion
{
$origin = $clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
- 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 getReverseDiff
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function getReverseDiff(): self
{
$diff = new self();
// tables
- 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 insertSql
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function insertSql(?string $datasource = null): bool
{
$statementsToInsert = [];
foreach ($this->getProperties($this->getSqlDbMapFilename()) as $sqlFile => $database) {
if ($datasource !== null && $database !== $datasource) {
- 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 loadDataModels
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function loadDataModels(): void
{
$schemas = [];
$totalNbTables = 0;
$dataModelFiles = $this->getSchemas();
- 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 buildFixtures
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildFixtures(string $fixturesDir, array $connections, InputInterface $input, OutputInterface $output): int
{
if (!file_exists($this->root . '/' . $fixturesDir)) {
$output->writeln(sprintf('<error>Directory "%s" not found.</error>', $fixturesDir));
File Collection.php
has 297 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
Method getModifyColumnDDL
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModifyColumnDDL(ColumnDiff $columnDiff): string
{
$ret = '';
$changedProperties = $columnDiff->getChangedProperties();
Function getDatabases
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getDatabases(): array
{
if ($this->databases === null) {
$databases = [];
foreach ($this->getDataModels() as $dataModel) {
- 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 addInitialize
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addInitialize(string &$script): void
{
$table = $this->getTable();
/** @var \Propel\Generator\Platform\DefaultPlatform $platform */
$platform = $this->getPlatform();
Method getNextStatement
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNextStatement(): string
{
$isAfterBackslash = false;
$isCommentLine = false;
$isInString = false;