Showing 693 of 740 total issues
Method getConfiguredPlatform
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfiguredPlatform(?ConnectionInterface $con = null, ?string $database = null): ?PlatformInterface
{
$platform = $this->get()['generator']['platformClass'];
if ($platform === null) {
Method isColumnForeignKeyOrDuplicated
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function isColumnForeignKeyOrDuplicated(Column $column): bool
{
$delegateTable = $column->getTable();
$table = $this->getTable();
$fks = [];
Method addObjectGetSyncParent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addObjectGetSyncParent(string &$script): void
{
$parentTable = $this->getParentTable();
$pkeys = $parentTable->getPrimaryKey();
$cptype = $pkeys[0]->getPhpType();
Method moveI18nColumns
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function moveI18nColumns(): void
{
$table = $this->getTable();
$i18nTable = $this->i18nTable;
Method addColumn
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
string $name,
string $phpName,
string $type,
bool $isNotNull = false,
?int $size = null,
Method convert
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convert(string $xmlToParse): array
{
$isFile = file_exists($xmlToParse);
if ($isFile) {
Method cleanupSQL
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cleanupSQL(string &$sql, array &$params, Criteria $values, DatabaseMap $dbMap): void
{
$i = 1;
$paramCols = [];
foreach ($params as $param) {
Method executeRollbackToPreviousVersion
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function executeRollbackToPreviousVersion(int $currentVersion, ?int $previousVersion = null): bool
{
$this->output->writeln(sprintf(
'Executing migration %s down',
$this->migrationManager->getMigrationClassName($currentVersion),
Method addFilterByArrayCol
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFilterByArrayCol(string &$script, Column $col): void
{
$singularPhpName = $col->getPhpSingularName();
$colName = $col->getName();
$variableName = $col->getCamelCaseName();
Method addInstancePool
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addInstancePool(): string
{
// No need to override instancePool if the PK is not composite
if (!$this->getTable()->hasCompositePrimaryKey()) {
return '';
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(?array $extraConf = [])
{
if ($extraConf === null) {
$extraConf = [];
}
Method mergeStatements
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeStatements(string $sql): string
{
$sqlParser = new SqlParser();
$sqlParser->setSQL($sql);
$statements = $sqlParser->explodeIntoStatements();
Method queryMethods
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function queryMethods(QueryBuilder $builder): string
{
$script = '';
foreach ($this->delegates as $delegate => $type) {
Method addForeignKeyVersionColumns
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addForeignKeyVersionColumns(): void
{
$versionTable = $this->versionTable;
foreach ($this->getVersionableFks() as $fk) {
$fkVersionColumnName = $fk->getLocalColumnName() . '_version';
Function getPluralForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getPluralForm(string $root): string
{
// save some time in the case that singular and plural are the same
if (in_array(strtolower($root), $this->uncountable, true)) {
return $root;
- 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 getClause
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getClause(array &$params): string
{
if ($this->joinCondition === null) {
$conditions = [];
for ($i = 0; $i < $this->count; $i++) {
- 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 __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($leftColumn = null, $rightColumn = null, ?string $joinType = null)
{
if ($leftColumn !== null && $rightColumn !== null) {
if (is_array($leftColumn) && is_array($rightColumn)) {
// join with multiple conditions
- 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 populateRelation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function populateRelation(
string $relation,
?Criteria $criteria = null,
?ConnectionInterface $con = 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 convertValueForColumn
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function convertValueForColumn($value, ColumnMap $colMap)
{
if ($colMap->getType() === 'OBJECT' && is_object($value)) {
$value = serialize($value);
} elseif ($colMap->getType() === 'ARRAY' && is_array($value)) {
- 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 convert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function convert(string $xmlToParse): array
{
$isFile = file_exists($xmlToParse);
if ($isFile) {
- 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"