Showing 740 of 740 total issues
Function getConfiguredSchemaParser
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
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
Function buildConnectionToVariableNameMap
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
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
Method populateRelation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
public function getAllObjectsFromRow(array $row): ActiveRecordInterface
{
// main object
[$obj, $col] = $this->getTableMap()->populateObject($row, 0, $this->getDataFetcher()->getIndexType());
Method execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
if ($this->hasInputOption('connection', $input)) {
Method addBuildRelations
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addBuildRelations(string &$script): void
{
$script .= "
/**
* Build the RelationMap objects for this table relationships
Method addDoInsertBodyWithIdMethod
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addDoInsertBodyWithIdMethod(): string
{
$table = $this->getTable();
$script = '';
foreach ($table->getPrimaryKey() as $col) {
Method buildModel
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildModel(): Database
{
/** @var \Propel\Generator\Config\GeneratorConfig $config */
$config = $this->getGeneratorConfig();
$connection = $this->getConnection();
Method getClassesForTable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getClassesForTable(Table $table, ?array $classTargets = null): string
{
$classTargets = $classTargets ?? $this->classTargets;
$script = '';
Method addPrune
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addPrune(string &$script): void
{
$table = $this->getTable();
$class = $this->getObjectClassName();
$objectName = '$' . $table->getCamelCaseName();
Method getDefaultValueString
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getDefaultValueString(Column $column): string
{
$defaultValue = var_export(null, true);
$val = $column->getPhpDefaultValue();
if ($val === null) {
Method addTemporalMutator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addTemporalMutator(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$dateTimeClass = $this->getDateTimeClass($col);
Method getAddTableDDL
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAddTableDDL(Table $table): string
{
$ret = $this->getUseSchemaDDL($table);
$ret .= $this->getAddSequenceDDL($table);
Method setRelationMap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setRelationMap(RelationMap $relationMap, ?string $leftTableAlias = null, ?string $relationAlias = null)
{
$leftCols = $relationMap->getLeftColumns();
$rightCols = $relationMap->getRightColumns();
$leftValues = $relationMap->getLocalValues();
Method getCriterionForClause
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method execute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
$connection = (string)$input->getArgument('connection');
Method buildLogger
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildLogger(string $name = 'defaultLogger'): LoggerInterface
{
if (!isset($this->loggerConfigurations[$name])) {
return $name !== 'defaultLogger' ? $this->getLogger() : new NullLogger();
}
Method getAddTableDDL
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAddTableDDL(Table $table): string
{
$table = clone $table;
$tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
Method compareColumns
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function compareColumns(bool $caseInsensitive = false): int
{
$fromTableColumns = $this->getFromTable()->getColumns();
$toTableColumns = $this->getToTable()->getColumns();
$columnDifferences = 0;
Method addDoOnDeleteCascade
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addDoOnDeleteCascade(string &$script): void
{
$table = $this->getTable();
$script .= "
/**