phpmyadmin/phpmyadmin

View on GitHub

Showing 2,025 of 2,025 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 2643 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 1912 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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                $.post(url, data, function (data) {
                                    if (data.success !== true) {
                                        ajaxShowMessage(data.error, false);
                
                                        return;
                Severity: Major
                Found in resources/js/src/triggers.ts and 1 other location - About 3 days to fix
                resources/js/src/database/events.ts on lines 214..320

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 659.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                    $.post(url, data, function (data) {
                                        if (data.success !== true) {
                                            ajaxShowMessage(data.error, false);
                
                                            return;
                Severity: Major
                Found in resources/js/src/database/events.ts and 1 other location - About 3 days to fix
                resources/js/src/triggers.ts on lines 224..330

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 659.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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 1345 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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          dropMultipleDialog: function ($this) {
                              // We ask for confirmation here
                              $this.confirm(window.Messages.strDropRTEitems, '', function () {
                                  /**
                                   * @var msg jQuery object containing the reference to
                      Severity: Major
                      Found in resources/js/src/triggers.ts and 1 other location - About 3 days to fix
                      resources/js/src/database/events.ts on lines 466..552

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 589.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          dropMultipleDialog: function ($this) {
                              // We ask for confirmation here
                              $this.confirm(window.Messages.strDropRTEitems, '', function () {
                                  /**
                                   * @var msg jQuery object containing the reference to
                      Severity: Major
                      Found in resources/js/src/database/events.ts and 1 other location - About 3 days to fix
                      resources/js/src/triggers.ts on lines 474..560

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 589.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              dropDialog: function ($this) {
                                  /**
                                   * @var $curr_row Object containing reference to the current row
                                   */
                                  var $currRow = $this.parents('tr');
                          Severity: Major
                          Found in resources/js/src/triggers.ts and 1 other location - About 2 days to fix
                          resources/js/src/database/events.ts on lines 391..464

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 497.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              dropDialog: function ($this) {
                                  /**
                                   * @var $curr_row Object containing reference to the current row
                                   */
                                  var $currRow = $this.parents('tr');
                          Severity: Major
                          Found in resources/js/src/database/events.ts and 1 other location - About 2 days to fix
                          resources/js/src/triggers.ts on lines 399..472

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 497.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          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
                            Severity
                            Category
                            Status
                            Source
                            Language