Function isColumnForeignKeyOrDuplicated
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function isColumnForeignKeyOrDuplicated(Column $column): bool
{
$delegateTable = $column->getTable();
$table = $this->getTable();
$fks = [];
- 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 modifyTable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modifyTable(): void
{
$table = $this->getTable();
$database = $table->getDatabase();
$delegates = explode(',', $this->parameters['to']);
Method isColumnForeignKeyOrDuplicated
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function isColumnForeignKeyOrDuplicated(Column $column): bool
{
$delegateTable = $column->getTable();
$table = $this->getTable();
$fks = [];
Method queryMethods
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function queryMethods(QueryBuilder $builder): string
{
$script = '';
foreach ($this->delegates as $delegate => $type) {
Method objectCall
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function objectCall(ObjectBuilder $builder): string
{
$script = '';
foreach ($this->delegates as $delegate => $type) {
$delegateTable = $this->getDelegateTable($delegate);
Method objectFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function objectFilter(string &$script): void
{
$p = new PhpParser($script, true);
$text = (string)$p->findMethod('toArray');
$matches = [];
Function queryAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function queryAttributes(): string
{
$script = '';
$collations = '';
- 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 objectFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function objectFilter(string &$script): void
{
$p = new PhpParser($script, true);
$text = (string)$p->findMethod('toArray');
$matches = [];
- 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 queryMethods
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function queryMethods(QueryBuilder $builder): string
{
$script = '';
foreach ($this->delegates as $delegate => $type) {
- 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"