keboola/php-datatypes

View on GitHub

Showing 97 of 102 total issues

Avoid unused parameters such as '$basetype'.
Open

public static function getTypeByBasetype(string $basetype): string
Severity: Minor
Found in src/Definition/GenericStorage.php by phpmd

Avoid unused parameters such as '$basetype'.
Open

public static function getTypeByBasetype(string $basetype): string
Severity: Minor
Found in src/Definition/Redshift.php by phpmd

The method getSQLDefinition uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$length = $this->getDefaultLength();
if ($length !== null) {
$definition .= sprintf('(%s)', $length);
}
Severity: Minor
Found in src/Definition/Synapse.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 43. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
switch (strtoupper($type)) {
case 'DECIMAL':
Severity: Minor
Found in src/Definition/Redshift.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 44. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
 
switch (strtoupper($type)) {
Severity: Minor
Found in src/Definition/Teradata.php by phpmd

The method getBasetype() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10.
Open

public function getBasetype(): string
{
switch (strtoupper($this->type)) {
case self::TYPE_BYTEINT:
case self::TYPE_INTEGER:
Severity: Minor
Found in src/Definition/Teradata.php by phpmd

The method validateCompression() has a Cyclomatic Complexity of 24. The configured cyclomatic complexity threshold is 10.
Open

private function validateCompression(string $type, string $compression): void
{
$valid = true;
$type = strtoupper($type);
switch (strtoupper($compression)) {
Severity: Minor
Found in src/Definition/Redshift.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 63. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
switch (strtoupper($type)) {
case 'CHAR':
Severity: Minor
Found in src/Definition/MySQL.php by phpmd

The method getBasetype() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
Open

public function getBasetype(): string
{
switch (strtoupper($this->type)) {
case self::TYPE_DECIMAL:
case self::TYPE_DEC:
Severity: Minor
Found in src/Definition/Exasol.php by phpmd

The method getDefaultLength() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

public function getDefaultLength()
{
switch (strtoupper($this->getType())) {
case self::TYPE_FLOAT:
return self::MAX_LENGTH_FLOAT;
Severity: Minor
Found in src/Definition/Synapse.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
switch (strtoupper($type)) {
case self::TYPE_FLOAT:
Severity: Minor
Found in src/Definition/Synapse.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 27. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
 
switch (strtoupper($type)) {
Severity: Minor
Found in src/Definition/Exasol.php by phpmd

The method validateLength() has a Cyclomatic Complexity of 46. The configured cyclomatic complexity threshold is 10.
Open

private function validateLength(string $type, $length = null): void
{
$valid = true;
switch (strtoupper($type)) {
case self::TYPE_NUMBER:
Severity: Minor
Found in src/Definition/Snowflake.php by phpmd

The method getDefaultLength() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
Open

private function getDefaultLength()
{
$out = null;
switch (strtoupper($this->type)) {
case self::TYPE_DECIMAL:
Severity: Minor
Found in src/Definition/Exasol.php by phpmd

The method getBasetype() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
Open

public function getBasetype(): string
{
switch (strtoupper($this->type)) {
case self::TYPE_INT:
case self::TYPE_BIGINT:
Severity: Minor
Found in src/Definition/Synapse.php by phpmd

The method validateNumericLength() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Open

protected function validateNumericLength(
$length,
int $firstMax,
int $secondMax,
bool $firstMustBeBigger = true
Severity: Minor
Found in src/Definition/Common.php by phpmd

The method getDefaultLength() has a Cyclomatic Complexity of 40. The configured cyclomatic complexity threshold is 10.
Open

private function getDefaultLength()
{
$out = null;
switch ($this->type) {
// decimals
Severity: Minor
Found in src/Definition/Teradata.php by phpmd
Severity
Category
Status
Source
Language