Showing 693 of 740 total issues
Function getTemplatePath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getTemplatePath(string $path): string
{
$srcPos = strrpos($path, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR);
if ($srcPos === false) {
// BC shim for old template paths
- 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 join
has a Cognitive Complexity of 12 (exceeds 5 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) {
- 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 next
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function next(): void
{
$nextNode = null;
$method = method_exists($this->curNode, 'retrieveNextSibling') ? 'retrieveNextSibling' : 'getNextSibling';
if ($this->valid()) {
- 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 formatRow
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function formatRow(array $row): array
{
foreach ($row as &$column) {
if (!is_scalar($column)) {
$column = $this->serialize($column);
- 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 applyBehaviorModifierBase
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function applyBehaviorModifierBase(string $hookName, string $modifier, string &$script, string $tab = ' '): void
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
$modifier = $behavior->$modifierGetter();
- 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 getRefRelatedBySuffix
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function getRefRelatedBySuffix(ForeignKey $fk): string
{
$relCol = '';
foreach ($fk->getMapping() as $mapping) {
[$localColumn, $foreignValueOrColumn] = $mapping;
- 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 getUseStatements
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getUseStatements(?string $ignoredNamespace = null): string
{
$script = '';
$declaredClasses = $this->declaredClasses;
unset($declaredClasses[$ignoredNamespace]);
- 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 getSequenceName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getSequenceName(Table $table): ?string
{
static $longNamesMap = [];
$result = null;
if ($table->getIdMethod() === IdMethod::NATIVE) {
- 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 getSequenceName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getSequenceName(Table $table): string
{
$result = null;
if ($table->getIdMethod() == IdMethod::NATIVE) {
$idMethodParams = $table->getIdMethodParameters();
- 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 generateScopePhp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function generateScopePhp(): array
{
$methodSignature = '';
$paramsDoc = '';
$buildScope = '';
- 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 moveI18nColumns
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function moveI18nColumns(): void
{
$table = $this->getTable();
$i18nTable = $this->i18nTable;
- 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 getTemplatePath
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getTemplatePath(string $path): string
{
$srcPos = strrpos($path, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR);
if ($srcPos === false) {
// BC shim for old template paths
Method parseKey
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseKey(string $key, $rawValue, array &$config): void
{
$value = $rawValue;
if (is_string($rawValue)) {
if (strlen($rawValue) <= 5 && in_array(strtolower($rawValue), ['true', 'false'], true)) {
Method parse
has 35 lines of code (exceeds 25 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'");
Method addRefFKRemove
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKRemove(string &$script, ForeignKey $refFK): void
{
$tblFK = $refFK->getTable();
$className = $this->getClassNameFromTable($refFK->getTable());
Method getConfiguredSchemaParser
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfiguredSchemaParser(?ConnectionInterface $con = null, $database = null): ?SchemaParserInterface
{
$reverse = $this->get()['migrations']['parserClass'];
if ($reverse === null) {
Method getDropTableDDL
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDropTableDDL(Table $table): string
{
$ret = '';
foreach ($table->getForeignKeys() as $fk) {
$ret .= "
Method appendForeignKeyNode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function appendForeignKeyNode(ForeignKey $foreignKey, DOMNode $parentNode): void
{
/** @var \DOMElement $foreignKeyNode */
$foreignKeyNode = $parentNode->appendChild($this->document->createElement('foreign-key'));
$foreignKeyNode->setAttribute('foreignTable', $foreignKey->getForeignTableCommonName());
Method getModifyTableDDL
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModifyTableDDL(TableDiff $tableDiff): string
{
$changedNotEditableThroughDirectDDL = $this->tableAlteringWorkaround && (
$tableDiff->hasModifiedFks()
|| $tableDiff->hasModifiedIndices()
Method generateScopePhp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateScopePhp(): array
{
$methodSignature = '';
$paramsDoc = '';
$buildScope = '';