phpmyadmin/phpmyadmin

View on GitHub

Showing 2,025 of 2,025 total issues

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

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

            $('#tableid_0').on('change', function () {
                // AJAX request for field type, collation, operators, and value field
                $.post('index.php?route=/table/zoom-search', {
                    'ajax_request': true,
                    'change_tbl_info': true,
        Severity: Major
        Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 2 days to fix
        resources/js/src/table/zoom_plot_jqplot.ts on lines 184..206

        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 403.

        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

                    that.$ajaxDialog = $('<div id="rteDialog">' + data.message + '</div>').dialog({
                        classes: {
                            'ui-dialog-titlebar-close': 'btn-close'
                        },
                        height: 600,
        Severity: Major
        Found in resources/js/src/database/routines.ts and 1 other location - About 2 days to fix
        resources/js/src/database/events.ts on lines 332..366

        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 403.

        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

                    that.$ajaxDialog = $('<div id="rteDialog">' + data.message + '</div>').dialog({
                        classes: {
                            'ui-dialog-titlebar-close': 'btn-close'
                        },
                        height: 500,
        Severity: Major
        Found in resources/js/src/database/events.ts and 1 other location - About 2 days to fix
        resources/js/src/database/routines.ts on lines 348..382

        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 403.

        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

            $('#tableid_1').on('change', function () {
                // AJAX request for field type, collation, operators, and value field
                $.post('index.php?route=/table/zoom-search', {
                    'ajax_request': true,
                    'change_tbl_info': true,
        Severity: Major
        Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 2 days to fix
        resources/js/src/table/zoom_plot_jqplot.ts on lines 159..181

        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 403.

        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

        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

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

                          for (key2 in DesignerConfig.contr[K][key]) {// table name
                              parts = key2.split('.');
                              if (DesignerHistory.found(tabLeft, parts[1]) > 0) {
                                  for (key3 in DesignerConfig.contr[K][key][key2]) {
                                      parts1 = DesignerConfig.contr[K][key][key2][key3][0].split('.');
          Severity: Major
          Found in resources/js/src/designer/history.ts and 1 other location - About 2 days to fix
          resources/js/src/designer/history.ts on lines 711..733

          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 373.

          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

                          for (key2 in DesignerConfig.contr[K][key]) {// table name
                              parts = key2.split('.');
                              if (DesignerHistory.found(tabUsed, parts[1]) > 0) {
                                  for (key3 in DesignerConfig.contr[K][key][key2]) {
                                      parts1 = DesignerConfig.contr[K][key][key2][key3][0].split('.');
          Severity: Major
          Found in resources/js/src/designer/history.ts and 1 other location - About 2 days to fix
          resources/js/src/designer/history.ts on lines 744..766

          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 373.

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

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

                $('#tableid_3').on('change', function () {
                    // AJAX request for field type, collation, operators, and value field
                    $.post('index.php?route=/table/zoom-search', {
                        'ajax_request': true,
                        'change_tbl_info': true,
            Severity: Major
            Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 2 days to fix
            resources/js/src/table/zoom_plot_jqplot.ts on lines 208..228

            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 370.

            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

                $('#tableid_2').on('change', function () {
                    // AJAX request for field type, collation, operators, and value field
                    $.post('index.php?route=/table/zoom-search', {
                        'ajax_request': true,
                        'change_tbl_info': true,
            Severity: Major
            Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 2 days to fix
            resources/js/src/table/zoom_plot_jqplot.ts on lines 230..250

            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 370.

            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 Export.php has 863 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * function for the main export logic
             */
            
            
            Severity: Major
            Found in src/Export/Export.php - About 2 days to fix

              File Rules.php has 833 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                Function exportData has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function exportData(
                        string $db,
                        string $table,
                        string $errorUrl,
                        string $sqlQuery,
                Severity: Minor
                Found in src/Plugins/Export/ExportSql.php - About 1 day 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

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

                        if ($this.attr('id') === 'bulkActionExportButton') {
                            var combined = {
                                success: true,
                                title: window.Messages.strExport,
                                message: '',
                Severity: Major
                Found in resources/js/src/triggers.ts and 1 other location - About 1 day to fix
                resources/js/src/database/events.ts on lines 68..103

                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 352.

                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

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

                        if ($this.attr('id') === 'bulkActionExportButton') {
                            var combined = {
                                success: true,
                                title: window.Messages.strExport,
                                message: '',
                Severity: Major
                Found in resources/js/src/database/events.ts and 1 other location - About 1 day to fix
                resources/js/src/triggers.ts on lines 77..112

                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 352.

                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 Tracking.php has 804 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Functions used for database and table tracking
                 */
                
                
                Severity: Major
                Found in src/Tracking/Tracking.php - About 1 day to fix
                  Severity
                  Category
                  Status
                  Source
                  Language