Showing 693 of 740 total issues
Function getConnection
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getConnection(array $params): PdoConnection
{
$params = $this->prepareParams($params);
if (!isset($params['dsn'])) {
- 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 addIndexes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function addIndexes(Table $table): void
{
/** @var \Propel\Runtime\DataFetcher\PDODataFetcher $dataFetcher */
$dataFetcher = $this->dbh->query("sp_indexes_rowset '" . $table->getName() . "'");
$dataFetcher->setStyle(PDO::FETCH_ASSOC);
- 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 parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function parse(Database $database, array $additionalTables = []): int
{
$tables = [];
/** @var \PDOStatement $stmt */
$stmt = $this->dbh->query("SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE'");
- 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 needAliasForClassName
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function needAliasForClassName(string $class, string $classNamespace): bool
{
// Should remove this check by not allowing nullable return values in getNamespace
if ($this->getNamespace() === null) {
return false;
- 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 addCopyInto
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function addCopyInto(string &$script): void
{
$table = $this->getTable();
$script .= "
- 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 generateBlockStorage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function generateBlockStorage($object, bool $isPrimaryKey = false): string
{
$vendorSpecific = $object->getVendorInfoForType('oracle');
if ($vendorSpecific->isEmpty()) {
return '';
- 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 getModifyTableDDL
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getModifyTableDDL(TableDiff $tableDiff): string
{
$ret = '';
$toTable = $tableDiff->getToTable();
- 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 appendDatabaseNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function appendDatabaseNode(Database $database, DOMNode $parentNode): void
{
/** @var \DOMElement $databaseNode */
$databaseNode = $parentNode->appendChild($this->document->createElement('database'));
$databaseNode->setAttribute('name', $database->getName());
- 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 addExtraIndices
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function addExtraIndices(): void
{
/**
* A collection of indexed columns. The key is the column name
* (concatenated with a comma in the case of multi-col index), the value is
- 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 getCrossFks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getCrossFks(): array
{
$crossFks = [];
foreach ($this->referrers as $refFK) {
if ($refFK->getTable()->isCrossRef()) {
- 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 modifyTable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function modifyTable(): void
{
$table = $this->getTable();
$database = $table->getDatabase();
$delegates = explode(',', $this->parameters['to']);
- 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 getAllObjectsFromRow
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllObjectsFromRow(array $row): ActiveRecordInterface
{
$col = 0;
// main object
Method addHashCode
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHashCode(string &$script): void
{
$script .= "
/**
* If the primary key is not null, return the hashcode of the
Method insertSql
has 43 lines of code (exceeds 25 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) {
Method getMigrationTableDDL
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMigrationTableDDL(TableDiff $tableDiff): string
{
$pattern = "
CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s;
DROP TABLE %s;
Method getTableOptions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getTableOptions(Table $table): array
{
$vi = $table->getVendorInfoForType('mysql');
$tableOptions = [];
// List of supported table options
Method execute
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
if ($this->hasInputOption('output-dir', $input)) {
Method addGetOMClassInheritance
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addGetOMClassInheritance(string &$script): void
{
$col = $this->getTable()->getChildrenColumn();
$script .= "
/**
Method addMutatorCloseBody
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addMutatorCloseBody(string &$script, Column $column): void
{
$table = $this->getTable();
if ($column->isForeignKey()) {
Method compareColumns
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function compareColumns(Column $fromColumn, Column $toColumn): array
{
$changedProperties = [];
// compare column types