Function addColumns
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
/** @var \PDOStatement $stmt */
$stmt = $this->dbh->query("SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, DATA_DEFAULT FROM USER_TAB_COLS WHERE TABLE_NAME = '" . $table->getName() . "'");
while ($row = $stmt->fetch(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
Method addColumns
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
/** @var \PDOStatement $stmt */
$stmt = $this->dbh->query("SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, DATA_DEFAULT FROM USER_TAB_COLS WHERE TABLE_NAME = '" . $table->getName() . "'");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
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
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'");
Function addIndexes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function addIndexes(Table $table): void
{
$columnNamesIndexedByIndexName = $this->getColumnNamesIndexedByIndexName($table);
foreach ($columnNamesIndexedByIndexName as $indexName => $columnNames) {
- 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"