keboola/php-datatypes

View on GitHub

Showing 97 of 102 total issues

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,
Severity: Major
Found in src/Definition/Teradata.php and 1 other location - About 3 hrs to fix
src/Definition/Synapse.php on lines 47..58

The class Exasol has an overall complexity of 92 which is very high. The configured complexity threshold is 50.
Open

class Exasol extends Common
{
public const METADATA_BACKEND = 'exasol';
/* core types */
public const TYPE_DECIMAL = 'DECIMAL'; // DECIMAL(p,s) = s ≤ p ≤ 36
Severity: Minor
Found in src/Definition/Exasol.php by phpmd

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 [...] ]
Severity: Minor
Found in src/Definition/Teradata.php by phpmd

The class Redshift has an overall complexity of 114 which is very high. The configured complexity threshold is 50.
Open

class Redshift extends Common
{
public const TYPES = [
'SMALLINT', 'INT2', 'INTEGER', 'INT', 'INT4', 'BIGINT', 'INT8',
'DECIMAL', 'NUMERIC',
Severity: Minor
Found in src/Definition/Redshift.php by phpmd

The class Synapse has an overall complexity of 66 which is very high. The configured complexity threshold is 50.
Open

class Synapse extends Common
{
public const METADATA_BACKEND = 'synapse';
public const TYPE_DECIMAL = 'DECIMAL';
public const TYPE_NUMERIC = 'NUMERIC';
Severity: Minor
Found in src/Definition/Synapse.php by phpmd

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)) {
Severity: Major
Found in src/Definition/Teradata.php - About 3 hrs to fix

    Function validateLength has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    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 - About 2 hrs to fix

    Function validateCompression has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    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 - About 2 hrs to fix

    Method validateLength has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    private function validateLength(string $type, $length = null): void
    {
    $valid = true;
     
    switch (strtoupper($type)) {
    Severity: Major
    Found in src/Definition/Exasol.php - About 2 hrs to fix

      Method getDefaultLength has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      private function getDefaultLength()
      {
      $out = null;
      switch ($this->type) {
      // decimals
      Severity: Major
      Found in src/Definition/Teradata.php - About 2 hrs to fix

        Function validateLength has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        private function validateLength(string $type, $length = null): void
        {
        $valid = true;
         
        switch (strtoupper($type)) {
        Severity: Minor
        Found in src/Definition/Exasol.php - About 2 hrs to fix

        File MySQL.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
         
        declare(strict_types=1);
         
        namespace Keboola\Datatype\Definition;
        Severity: Minor
        Found in src/Definition/MySQL.php - About 2 hrs to fix

          Method validateLength has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          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 - About 2 hrs to fix

            Method getBasetype has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            public function getBasetype(): string
            {
            switch (strtoupper($this->type)) {
            case self::TYPE_INT:
            case self::TYPE_INTEGER:
            Severity: Minor
            Found in src/Definition/Snowflake.php - About 1 hr to fix

              Method getBasetype has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              public function getBasetype(): string
              {
              switch (strtoupper($this->type)) {
              case 'SMALLINT':
              case 'INT2':
              Severity: Minor
              Found in src/Definition/Redshift.php - About 1 hr to fix

                Method getBasetype has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                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 - About 1 hr to fix

                  Method getDefaultLength has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    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:
                    Severity: Minor
                    Found in src/Definition/Teradata.php - About 1 hr to fix

                      Method getBasetype has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      public function getBasetype(): string
                      {
                      switch (strtoupper($this->type)) {
                      case 'INT':
                      case 'INTEGER':
                      Severity: Minor
                      Found in src/Definition/MySQL.php - About 1 hr to fix

                        Method getBasetype has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        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 - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language