Showing 15 of 15 total issues
File Teradata.php
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1); namespace Keboola\Datatype\Definition;
The class Teradata has an overall complexity of 135 which is very high. The configured complexity threshold is 50. Open
class Teradata extends Common{ //https://docs.teradata.com/r/Ri8d7iL59tIPr1FZNKPLMw/DlfSbsVEC48atCIcADa5IA /* numbers */ public const TYPE_BYTEINT = 'BYTEINT'; // -128 to 127, 1B, BYTEINT [ attributes [...] ]
- Exclude checks
Method validateLength
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateLength(string $type, $length = null): void { $valid = true; switch (strtoupper($type)) {
Method getDefaultLength
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDefaultLength() { $out = null; switch ($this->type) { // decimals
Method getBasetype
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBasetype(): string { switch (strtoupper($this->type)) { case self::TYPE_BYTEINT: case self::TYPE_INTEGER:
Function validateLength
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function validateLength(string $type, $length = null): void { $valid = true; switch (strtoupper($type)) {
- Read upRead up
Function getDefaultLength
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getDefaultLength() { $out = null; switch ($this->type) { // decimals
- Read upRead up
Function buildTypeWithLength
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildTypeWithLength(): string { $type = $this->getType(); $definition = $type; if (!in_array($definition, self::TYPES_WITHOUT_LENGTH)) {
- Read upRead up
Function getBasetype
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getBasetype(): string { switch (strtoupper($this->type)) { case self::TYPE_BYTEINT: case self::TYPE_INTEGER:
- Read upRead up
Avoid too many return
statements within this method. Open
return false;
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)) {
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
Avoid unused parameters such as '$basetype'. Open
public static function getTypeByBasetype(string $basetype): string
- Read upRead up
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
public const TYPES_WITH_SIMPLE_LENGTH = [ self::TYPE_BYTE, self::TYPE_VARBYTE, self::TYPE_TIME, self::TYPE_TIMESTAMP,
- Read upRead up