phpmyadmin/phpmyadmin

View on GitHub

Showing 1,419 of 2,002 total issues

Function makeGrid has a Cognitive Complexity of 513 (exceeds 5 allowed). Consider refactoring.
Open

const makeGrid = function (t, enableResize = undefined, enableReorder = undefined, enableVisib = undefined, enableGridEdit = undefined) {
    var isResizeEnabled = enableResize === undefined ? true : enableResize;
    var isReorderEnabled = enableReorder === undefined ? true : enableReorder;
    var isVisibEnabled = enableVisib === undefined ? true : enableVisib;
    var isGridEditEnabled = enableGridEdit === undefined ? true : enableGridEdit;
Severity: Minor
Found in resources/js/src/makegrid.ts - About 1 wk to fix

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 makeGrid has 1594 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const makeGrid = function (t, enableResize = undefined, enableReorder = undefined, enableVisib = undefined, enableGridEdit = undefined) {
    var isResizeEnabled = enableResize === undefined ? true : enableResize;
    var isReorderEnabled = enableReorder === undefined ? true : enableReorder;
    var isVisibEnabled = enableVisib === undefined ? true : enableVisib;
    var isGridEditEnabled = enableGridEdit === undefined ? true : enableGridEdit;
Severity: Major
Found in resources/js/src/makegrid.ts - About 1 wk to fix

    File functions.ts has 2683 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import $ from 'jquery';
    import { AJAX } from './ajax.ts';
    import { Navigation } from './navigation.ts';
    import { CommonParams } from './common.ts';
    import tooltip from './tooltip.ts';
    Severity: Major
    Found in resources/js/src/modules/functions.ts - About 1 wk to fix

      File Settings.php has 2193 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare(strict_types=1);
      
      namespace PhpMyAdmin\Config;
      Severity: Major
      Found in src/Config/Settings.php - About 6 days to fix

        File ExportSql.php has 1921 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Set of functions used to build SQL dumps of tables
         */
        
        
        Severity: Major
        Found in src/Plugins/Export/ExportSql.php - About 5 days to fix

          File monitor.ts has 1886 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import $ from 'jquery';
          import { AJAX } from '../../modules/ajax.ts';
          import { Functions } from '../../modules/functions.ts';
          import { CommonParams } from '../../modules/common.ts';
          import tooltip from '../../modules/tooltip.ts';
          Severity: Major
          Found in resources/js/src/server/status/monitor.ts - About 5 days to fix

            File move.ts has 1741 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import $ from 'jquery';
            import { Functions } from '../modules/functions.ts';
            import { CommonParams } from '../modules/common.ts';
            import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
            import refreshMainContent from '../modules/functions/refreshMainContent.ts';
            Severity: Major
            Found in resources/js/src/designer/move.ts - About 4 days to fix

              File makegrid.ts has 1645 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import $ from 'jquery';
              import { AJAX } from './modules/ajax.ts';
              import { Functions } from './modules/functions.ts';
              import { CommonParams } from './modules/common.ts';
              import tooltip from './modules/tooltip.ts';
              Severity: Major
              Found in resources/js/src/makegrid.ts - About 4 days to fix

                Settings has 194 functions (exceeds 20 allowed). Consider refactoring.
                Open

                final class Settings
                {
                    /**
                     * Your phpMyAdmin URL.
                     *
                Severity: Major
                Found in src/Config/Settings.php - About 3 days to fix

                  File services_controllers.php has 1361 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  declare(strict_types=1);
                  
                  use PhpMyAdmin\Config\PageSettings;
                  Severity: Major
                  Found in app/services_controllers.php - About 3 days to fix

                    Method getGeneric has 705 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function getGeneric(): array
                        {
                            return [
                                // Queries
                                [
                    Severity: Major
                    Found in src/Advisory/Rules.php - About 3 days to fix

                      File console.ts has 1187 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import $ from 'jquery';
                      import CodeMirror from 'codemirror';
                      import { AJAX } from './ajax.ts';
                      import { Functions } from './functions.ts';
                      import { CommonParams } from './common.ts';
                      Severity: Major
                      Found in resources/js/src/modules/console.ts - About 3 days to fix

                        File Export.php has 1184 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        declare(strict_types=1);
                        
                        namespace PhpMyAdmin\Config\Settings;
                        Severity: Major
                        Found in src/Config/Settings/Export.php - About 3 days to fix

                          Method getDescriptions has 517 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function getDescriptions(): array
                              {
                                  /** @var array<string, string> $descriptionsMap */
                                  static $descriptionsMap = [];
                          
                          
                          Severity: Major
                          Found in src/Config/Descriptions.php - About 2 days to fix

                            File navigation.ts has 998 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import $ from 'jquery';
                            import { CommonParams } from './common.ts';
                            import { Config } from './config.ts';
                            import { ajaxRemoveMessage, ajaxShowMessage } from './ajax-message.ts';
                            import updateNavigationWidthConfig from './navigation/updateNavigationWidthConfig.ts';
                            Severity: Major
                            Found in resources/js/src/modules/navigation.ts - About 2 days to fix

                              File sql.ts has 963 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import $ from 'jquery';
                              import { AJAX } from './modules/ajax.ts';
                              import { Functions } from './modules/functions.ts';
                              import { Navigation } from './modules/navigation.ts';
                              import { CommonParams } from './modules/common.ts';
                              Severity: Major
                              Found in resources/js/src/sql.ts - About 2 days to fix

                                File Descriptions.php has 948 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /**
                                 * Verbose descriptions for settings.
                                 */
                                
                                
                                Severity: Major
                                Found in src/Config/Descriptions.php - About 2 days to fix

                                  Export has 111 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  final class Export
                                  {
                                      /**
                                       * ```php
                                       * $cfg['Export']['format'] = 'sql';
                                  Severity: Major
                                  Found in src/Config/Settings/Export.php - About 2 days to fix

                                    Function getTableDef has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function getTableDef(
                                            string $db,
                                            string $table,
                                            bool $showDates = false,
                                            bool $addSemicolon = true,
                                    Severity: Minor
                                    Found in src/Plugins/Export/ExportSql.php - About 2 days to fix

                                    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

                                    File export.ts has 868 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import $ from 'jquery';
                                    import { AJAX } from './modules/ajax.ts';
                                    import { Functions } from './modules/functions.ts';
                                    import { CommonParams } from './modules/common.ts';
                                    import highlightSql from './modules/sql-highlight.ts';
                                    Severity: Major
                                    Found in resources/js/src/export.ts - About 2 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language