Showing 693 of 740 total issues
Function getColumnDefaultValueDDL
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getColumnDefaultValueDDL(Column $col): string
{
$default = '';
$defaultValue = $col->getDefaultValue();
if ($defaultValue !== 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 addGeneratorSection
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addGeneratorSection(ArrayNodeDefinition $node): void
{
$node
->children()
->arrayNode('generator')
Method addToArray
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addToArray(string &$script): void
{
$fks = $this->getTable()->getForeignKeys();
$referrers = $this->getTable()->getReferrers();
$hasFks = count($fks) > 0 || count($referrers) > 0;
Method addUpdateLoadedNodes
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addUpdateLoadedNodes(string &$script): void
{
$queryClassName = $this->queryClassName;
$objectClassName = $this->objectClassName;
$tableMapClassName = $this->tableMapClassName;
ModelWith
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ModelWith
{
/**
* @var string
*/
File PdoAdapter.php
has 284 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 modifyTable
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modifyTable(): void
{
$table = $this->getTable();
$parentTable = $this->getParentTable();
Method addRuntimeSection
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRuntimeSection(ArrayNodeDefinition $node): void
{
$node
->children()
->arrayNode('runtime')
Method getColumnDDL
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnDDL(Column $col): string
{
$domain = $col->getDomain();
$sqlType = $domain->getSqlType();
$notNullString = $this->getNullString($col->isNotNull());
Function parseKey
has a Cognitive Complexity of 20 (exceeds 5 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)) {
- 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 fixNamespaceDeclarations
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function fixNamespaceDeclarations(string $source): string
{
$cooperativeLexems = [T_WHITESPACE, T_NS_SEPARATOR, T_STRING];
if (PHP_VERSION_ID >= 80000) {
- 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 addGetPrimaryKeyFromRow
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function addGetPrimaryKeyFromRow(string &$script): void
{
$script .= "
/**
* Retrieves the primary key from the DB resultset row
- 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 addFilterByCol
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function addFilterByCol(string &$script, Column $col): void
{
$colPhpName = $col->getPhpName();
$colName = $col->getName();
$variableName = $col->getCamelCaseName();
- 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 isIndex
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function isIndex(array $keys): bool
{
if ($this->indices) {
foreach ($this->indices as $index) {
if (count($keys) === count($index->getColumns())) {
- 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 addDoDelete
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoDelete(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method __toString
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __toString(): string
{
$tables = [];
foreach ($this->getTables() as $table) {
$columns = [];
AbstractFormatter
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractFormatter
{
/**
* @var string|null
*/
ArchivableBehavior
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class ArchivableBehavior extends Behavior
{
/**
* Default parameters value
*
Method build
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build(): void
{
$this->validate();
$totalNbFiles = 0;
Method addCrossFKDoAdd
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKDoAdd(string &$script, CrossForeignKeys $crossFKs): void
{
$selfRelationNamePlural = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), true);
$relatedObjectClassName = $this->getCrossFKsPhpNameAffix($crossFKs, false);
$className = $this->getClassNameFromTable($crossFKs->getIncomingForeignKey()->getTable());