XoopsModules25x/adminer

View on GitHub
include/plugins/foreign-system.php

Summary

Maintainability
D
1 day
Test Coverage

Method foreignKeys has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function foreignKeys($table) {
        if (DRIVER == 'server' && DB == 'mysql') {
            switch ($table) {
                case 'columns_priv': return array(array('table' => 'user', 'source' => array('Host', 'User'), 'target' => array('Host', 'User')));
                case 'db': return array(array('table' => 'user', 'source' => array('Host', 'User'), 'target' => array('Host', 'User')));
Severity: Major
Found in include/plugins/foreign-system.php - About 2 hrs to fix

    Avoid too many return statements within this method.
    Open

                    case 'CHARACTER_SETS': return array(array('source' => array('DEFAULT_COLLATE_NAME')) + $collations);
    Severity: Major
    Found in include/plugins/foreign-system.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      case 'ROUTINES': return array_merge(array(array('source' => array('ROUTINE_CATALOG', 'ROUTINE_SCHEMA')) + $schemata), $routine_charsets);
      Severity: Major
      Found in include/plugins/foreign-system.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        case 'FILES': return array($schemata, $tables);
        Severity: Major
        Found in include/plugins/foreign-system.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          case 'KEY_COLUMN_USAGE': return array(array('source' => array('CONSTRAINT_CATALOG', 'CONSTRAINT_SCHEMA')) + $schemata, $schemata, $tables, $columns, array('source' => array('TABLE_CATALOG', 'REFERENCED_TABLE_SCHEMA')) + $schemata, array(
                                                                                                                                                                                                                                                                     'source' => array(
                                                                   'TABLE_CATALOG',
                                                                   'REFERENCED_TABLE_SCHEMA',
                                                                   'REFERENCED_TABLE_NAME'
          Severity: Major
          Found in include/plugins/foreign-system.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            case 'procs_priv': return array(array('table' => 'user', 'source' => array('Host', 'User'), 'target' => array('Host', 'User')), array('table' => 'proc', 'source' => array('Db', 'Routine_name'), 'target' => array('db', 'name')));
            Severity: Major
            Found in include/plugins/foreign-system.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              case 'time_zone_name': return array(array('table' => 'time_zone', 'source' => array('Time_zone_id'), 'target' => array('Time_zone_id')));
              Severity: Major
              Found in include/plugins/foreign-system.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                case 'tables_priv': return array(array('table' => 'user', 'source' => array('Host', 'User'), 'target' => array('Host', 'User')));
                Severity: Major
                Found in include/plugins/foreign-system.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  case 'SCHEMA_PRIVILEGES': return array($schemata);
                  Severity: Major
                  Found in include/plugins/foreign-system.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    case 'EVENTS': return array_merge(array(array('source' => array('EVENT_CATALOG', 'EVENT_SCHEMA')) + $schemata), $routine_charsets);
                    Severity: Major
                    Found in include/plugins/foreign-system.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      case 'PARTITIONS': return array($schemata, $tables);
                      Severity: Major
                      Found in include/plugins/foreign-system.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        case 'SCHEMATA': return array(array('source' => array('DEFAULT_CHARACTER_SET_NAME')) + $character_sets, array('source' => array('DEFAULT_COLLATION_NAME')) + $collations);
                        Severity: Major
                        Found in include/plugins/foreign-system.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          case 'help_topic': return array(array('table' => 'help_category', 'source' => array('help_category_id'), 'target' => array('help_category_id')));
                          Severity: Major
                          Found in include/plugins/foreign-system.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            case 'COLLATIONS': return array($character_sets);
                            Severity: Major
                            Found in include/plugins/foreign-system.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              case 'TABLES': return array($schemata, array('source' => array('TABLE_COLLATION')) + $collations);
                              Severity: Major
                              Found in include/plugins/foreign-system.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                case 'TABLE_PRIVILEGES': return array($schemata, $tables);
                                Severity: Major
                                Found in include/plugins/foreign-system.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  case 'COLUMN_PRIVILEGES': return array($schemata, $tables, $columns);
                                  Severity: Major
                                  Found in include/plugins/foreign-system.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    case 'COLLATION_CHARACTER_SET_APPLICABILITY': return array($collations, $character_sets);
                                    Severity: Major
                                    Found in include/plugins/foreign-system.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      case 'COLUMNS': return array($schemata, $tables, $character_sets, $collations);
                                      Severity: Major
                                      Found in include/plugins/foreign-system.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        case 'REFERENTIAL_CONSTRAINTS': return array(array('source' => array('CONSTRAINT_CATALOG', 'CONSTRAINT_SCHEMA')) + $schemata, array('source' => array('UNIQUE_CONSTRAINT_CATALOG', 'UNIQUE_CONSTRAINT_SCHEMA')) + $schemata, array(
                                                                                                                                                                                                                                                                                         'source' => array(
                                                                                                        'CONSTRAINT_CATALOG',
                                                                                                        'CONSTRAINT_SCHEMA',
                                                                                                        'TABLE_NAME'
                                        Severity: Major
                                        Found in include/plugins/foreign-system.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          case 'STATISTICS': return array($schemata, $tables, $columns, array('source' => array('TABLE_CATALOG', 'INDEX_SCHEMA')) + $schemata);
                                          Severity: Major
                                          Found in include/plugins/foreign-system.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            case 'TABLE_CONSTRAINTS': return array(array('source' => array('CONSTRAINT_CATALOG', 'CONSTRAINT_SCHEMA')) + $schemata, array('source' => array('CONSTRAINT_CATALOG', 'TABLE_SCHEMA')) + $schemata, array('source' => array('CONSTRAINT_CATALOG', 'TABLE_SCHEMA', 'TABLE_NAME')) + $tables);
                                            Severity: Major
                                            Found in include/plugins/foreign-system.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                              case 'TRIGGERS': return array_merge(array(array('source' => array('TRIGGER_CATALOG', 'TRIGGER_SCHEMA')) + $schemata, array('source' => array('EVENT_OBJECT_CATALOG', 'EVENT_OBJECT_SCHEMA')) + $schemata, array(
                                                                                                                                                                                                                                                                            'source' => array(
                                                                                                           'EVENT_OBJECT_CATALOG',
                                                                                                           'EVENT_OBJECT_SCHEMA',
                                                                                                           'EVENT_OBJECT_TABLE'
                                              Severity: Major
                                              Found in include/plugins/foreign-system.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                case 'time_zone_transition_type': return array(array('table' => 'time_zone', 'source' => array('Time_zone_id'), 'target' => array('Time_zone_id')));
                                                Severity: Major
                                                Found in include/plugins/foreign-system.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                  case 'time_zone_transition': return array(array('table' => 'time_zone', 'source' => array('Time_zone_id'), 'target' => array('Time_zone_id')), array(
                                                                      'table' => 'time_zone_transition_type', 'source' => array('Time_zone_id', 'Transition_type_id'), 'target' => array(
                                                                      'Time_zone_id',
                                                                      'Transition_type_id'
                                                                  )));
                                                  Severity: Major
                                                  Found in include/plugins/foreign-system.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                    case 'VIEWS': return array($schemata);
                                                    Severity: Major
                                                    Found in include/plugins/foreign-system.php - About 30 mins to fix

                                                      There are no issues that match your filters.

                                                      Category
                                                      Status