Showing 693 of 740 total issues
Method getColumnDDL
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnDDL(Column $col): string
{
$domain = $col->getDomain();
$ddl = [$this->quoteIdentifier($col->getName())];
Method queryMethods
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function queryMethods(AbstractOMBuilder $builder): string
{
$script = '';
if ($this->withUpdatedAt()) {
Consider simplifying this complex logical expression. Open
if ($this->tableAlteringWorkaround && !$changedNotEditableThroughDirectDDL && $tableDiff->hasAddedColumns()) {
$addedCols = $tableDiff->getAddedColumns();
foreach ($addedCols as $column) {
$sqlChangeNotSupported =
//The column may not have a PRIMARY KEY or UNIQUE constraint.
Method getColumnFromName
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getColumnFromName(string $columnName, bool $failSilently = true): array
{
if (strpos($columnName, '.') === false) {
$prefix = (string)$this->getModelAliasOrName();
} else {
Method executeRollbackForDatasource
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function executeRollbackForDatasource(string $datasource, string $sql): void
{
$connection = $this->migrationManager->getConnection($datasource);
if ($this->isVerbose()) {
Method addFieldsAttributes
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFieldsAttributes(): string
{
$tableColumns = $this->getTable()->getColumns();
$fieldNamesPhpName = '';
Method build
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build(): void
{
foreach ($this->getDatabases() as $database) {
$dotSyntax = "digraph G {\n";
Method join
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function join(string $relation, string $joinType = Criteria::INNER_JOIN)
{
// relation looks like '$leftName.$relationName $relationAlias'
[$fullName, $relationAlias] = self::getClassAndAlias($relation);
if (strpos($fullName, '.') === false) {
Method fixNamespaceDeclarations
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fixNamespaceDeclarations(string $source): string
{
$cooperativeLexems = [T_WHITESPACE, T_NS_SEPARATOR, T_STRING];
if (PHP_VERSION_ID >= 80000) {
Method addShiftRLValues
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addShiftRLValues(string &$script): void
{
$objectClassName = $this->objectClassName;
$useScope = $this->behavior->useScope();
$tableMapClassName = $this->builder->getTableMapClass();
Function buildFixtures
has a Cognitive Complexity of 13 (exceeds 5 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));
- 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 format
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function format(?DataFetcherInterface $dataFetcher = null)
{
$this->checkInit();
if ($dataFetcher) {
$this->setDataFetcher($dataFetcher);
- 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 declareClassNamespace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function declareClassNamespace(string $class, string $namespace = '', $alias = false): string
{
$namespace = trim($namespace, '\\');
// check if the class is already declared
- 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 addClassBody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function addClassBody(string &$script): void
{
$table = $this->getTable();
// namespaces
- 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 buildConnectionToVariableNameMap
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected static function buildConnectionToVariableNameMap(array $migrationsUp, array $migrationsDown): array
{
$connectionToVariableName = [];
foreach ([$migrationsUp, $migrationsDown] as $migrations) {
$connectionNames = array_keys($migrations);
- 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 mergeStatements
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function mergeStatements(string $sql): string
{
$sqlParser = new SqlParser();
$sqlParser->setSQL($sql);
$statements = $sqlParser->explodeIntoStatements();
- 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 compareIndices
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function compareIndices(bool $caseInsensitive = false): int
{
$indexDifferences = 0;
$fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
$toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());
- 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 getConfiguredSchemaParser
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getConfiguredSchemaParser(?ConnectionInterface $con = null, $database = null): ?SchemaParserInterface
{
$reverse = $this->get()['migrations']['parserClass'];
if ($reverse === 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
Method populateRelation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function populateRelation(
string $relation,
?Criteria $criteria = null,
?ConnectionInterface $con = null
) {
Method getAllObjectsFromRow
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllObjectsFromRow(array $row): ActiveRecordInterface
{
// main object
[$obj, $col] = $this->getTableMap()->populateObject($row, 0, $this->getDataFetcher()->getIndexType());