src/Types.php
File Types.php
has 611 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* SQL data types definition
*/
Method getFunctionsClass
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFunctionsClass(string $class): array
{
$isMariaDB = $this->dbi->isMariaDB();
$serverVersion = $this->dbi->getVersion();
Method getTypeDescription
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTypeDescription(string $type): string
{
return match (mb_strtoupper($type)) {
'TINYINT' => __('A 1-byte integer, signed range is -128 to 127, unsigned range is 0 to 255'),
'SMALLINT' => __('A 2-byte integer, signed range is -32,768 to 32,767, unsigned range is 0 to 65,535'),
Method getColumns
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getColumns(): array
{
$isMariaDB = $this->dbi->isMariaDB();
$serverVersion = $this->dbi->getVersion();
$isUUIDSupported = Compatibility::isUUIDSupported($this->dbi);
Types
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Types
{
public function __construct(private DatabaseInterface $dbi)
{
}
Method getTypeClass
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTypeClass(string $type): string
{
return match (mb_strtoupper($type)) {
'TINYINT',
'SMALLINT',
Function getFunctionsClass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getFunctionsClass(string $class): array
{
$isMariaDB = $this->dbi->isMariaDB();
$serverVersion = $this->dbi->getVersion();
- 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 getColumns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getColumns(): array
{
$isMariaDB = $this->dbi->isMariaDB();
$serverVersion = $this->dbi->getVersion();
$isUUIDSupported = Compatibility::isUUIDSupported($this->dbi);
- 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
Open
return [
'GeomFromText',
'GeomFromWKB',
'GeomCollFromText',
Avoid too many return
statements within this method. Open
Open
return [];