Showing 693 of 740 total issues
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 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
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
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;
Method objectMethods
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function objectMethods(ObjectBuilder $builder): string
{
$this->setBuilder($builder);
$script = '';
Method addForeignKeys
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addForeignKeys(Table $table): void
{
$database = $table->getDatabase();
$dataFetcher = $this->dbh->query(sprintf('SHOW CREATE TABLE %s', $this->getPlatform()->doQuoting($table->getName())));
Method execute
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
$inputOptions = $input->getOptions();
File StandardServiceContainer.php
has 289 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
Function doUpdate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function doUpdate($updateValues, ConnectionInterface $con, bool $forceIndividualSaves = false): int
{
if ($forceIndividualSaves) {
if ($updateValues instanceof Criteria) {
throw new LogicException('Parameter #1 `$updateValues` must be an array while `$forceIndividualSaves = true`.');
- 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 __call
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function __call(string $name, array $arguments)
{
// Maybe it's a magic call to one of the methods supporting it, e.g. 'findByTitle'
static $methods = ['findBy', 'findOneBy', 'requireOneBy', 'filterBy', 'orderBy', 'groupBy'];
foreach ($methods as $methodName) {
- 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 getAllObjectsFromRow
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getAllObjectsFromRow(array $row): ActiveRecordInterface
{
$col = 0;
// main object
- 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 getAllObjectsFromRow
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getAllObjectsFromRow(array $row): ActiveRecordInterface
{
// main object
[$obj, $col] = $this->getTableMap()->populateObject($row, 0, $this->getDataFetcher()->getIndexType());
- 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"