Showing 18 of 19 total issues
Function sortTablesByConstraintsRecursive
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function sortTablesByConstraintsRecursive(string $schema, array $tables, array $sortedTables = []): array
{
$unsortedTables = [];
$connection = $this->getConnection();
foreach ($tables as $tableName) {
- 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 generateField
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function generateField(FieldEntity $fieldEntity): string
{
$argumentString = '';
$arguments = $fieldEntity->getArguments();
$options = $fieldEntity->getOptions();
- 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 writeToDisk
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function writeToDisk(
string $name,
string $path,
int $currentAmount = -1,
int $maxAmount = -1,
- 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 sortTablesByConstraintsRecursive
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sortTablesByConstraintsRecursive(string $schema, array $tables, array $sortedTables = []): array
{
$unsortedTables = [];
$connection = $this->getConnection();
foreach ($tables as $tableName) {
Method generateField
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateField(FieldEntity $fieldEntity): string
{
$argumentString = '';
$arguments = $fieldEntity->getArguments();
$options = $fieldEntity->getOptions();
Method resolveTableSchema
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveTableSchema(string $schema, string $table): ResultEntity
{
$definitions = $this->getDefinitions();
$sortedDefinitions = TopSort::sort($definitions);
$connection = $this->getDoctrineConnection();
Method convertColumnToFieldEntity
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertColumnToFieldEntity(string $table, Column $column): FieldEntity
{
$fieldEntity = new FieldEntity();
$fieldEntity->setTable($table);
$fieldEntity->setColumnName($column->getName());
Function populateData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function populateData(string $content, array $data): string
{
foreach ($data as $key => $value) {
if (!is_object($value)) {
if (is_array($value)) {
- 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 generateByResult
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateByResult(ResultEntity $resultEntity, string $customMigrationClass = ''): void
{
$this->setMigrationFiles([]);
$tableName = $resultEntity->getTableName();
$mapper = $this->getMapper();
Function generateForeignKeys
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function generateForeignKeys(string $table, array $foreignKeys): array
{
$result = [];
foreach ($foreignKeys as $foreignKey) {
- 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 generateIndexes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function generateIndexes(array $indexes): array
{
$combinedIndexes = [];
foreach ($indexes as $index) {
if ($index instanceof Index === false || $index->getName() === 'PRIMARY') {
- 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 generateMigrationForTable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $database,
string $table,
int $currentAmount = -1,
int $maxAmount = -1,
int $timestamp = -1
Method writeToDisk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $name,
string $path,
int $currentAmount = -1,
int $maxAmount = -1,
int $timestamp = -1
Method writeToDisk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $name,
string $path,
int $currentAmount = -1,
int $maxAmount = -1,
int $timestamp = -1
Method generateMigrationForTable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $database,
string $table,
int $currentAmount = -1,
int $maxAmount = -1,
int $timestamp = -1
Function convertColumnToFieldEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function convertColumnToFieldEntity(string $table, Column $column): FieldEntity
{
$fieldEntity = new FieldEntity();
$fieldEntity->setTable($table);
$fieldEntity->setColumnName($column->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 generateFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function generateFields(string $table, array $columns): array
{
$result = [];
if (0 !== count($columns)) {
- 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 generateByResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function generateByResult(ResultEntity $resultEntity, string $customMigrationClass = ''): void
{
$this->setMigrationFiles([]);
$tableName = $resultEntity->getTableName();
$mapper = $this->getMapper();
- 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"