Showing 28 of 115 total issues
Method insertMultiple
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function insertMultiple(\PDO $pdo, string $table, array $keys, array $datas, int $onDuplicate = self::DUPLICATE_FAIL): int
Function hasForeignKeysOnlyOn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function hasForeignKeysOnlyOn(array $tables): bool
{
if (empty($this->indexes)) return true;
$names = array_keys($tables);
foreach ($this->indexes as $index) {
- 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 fromSql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function fromSql(string $type, string $collation = null, bool $isBoolean = false): Type
{
//TODO register parser
$result = BoolType::parseBool($type);
if ($result != null) return $result;
- 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 toSql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function toSql(SqlSetting $setting): string
{
$sql = '`' . $this->name . '` ';
$sql .= $this->type->toSql() . ' ';
if (!$this->null) $sql .= "NOT 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
Function fromSqlCreate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function fromSqlCreate(DatabaseBuilder $db, string $sql): void
{
list($tableName, $remaining) = explode('(', $sql, 2);
$tableName = trim(str_replace(["CREATE TABLE", "IF NOT EXISTS", "`"], "", $tableName));
$tb = $db->table($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
Avoid too many return
statements within this method. Open
if ($result != null) return $result;
Avoid too many return
statements within this method. Open
if ($result != null) return $result;
Avoid too many return
statements within this method. Open
if ($result != null) return $result;