phpmyadmin/phpmyadmin

View on GitHub

Showing 1,992 of 1,992 total issues

Function onloadEnumSetEditor has 264 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function onloadEnumSetEditor (): void {
    $(document).on('click', 'a.open_enum_editor', function () {
        // Get the name of the column that is being edited
        var colname = ($(this).closest('tr').find('input').first().val() as string);
        var title;
Severity: Major
Found in resources/js/src/modules/functions.ts - About 1 day to fix

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

            function showExport (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 1 day to fix
    resources/js/src/database/routines.ts on lines 123..164

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

    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

            function showExport (data) {
                if (data.success !== true) {
                    ajaxShowMessage(data.error, false);
    
                    return;
    Severity: Major
    Found in resources/js/src/database/routines.ts and 1 other location - About 1 day to fix
    resources/js/src/database/events.ts on lines 107..148

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

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

        public function getAllowedValues(): array
        {
            $config = Config::getInstance();
    
            return [
    Severity: Major
    Found in src/Config/ConfigFile.php - About 1 day to fix

      Function canvasClick has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

      const canvasClick = function (id, event) {
          var n = 0;
          var selected = 0;
          var a = [];
          var Key0;
      Severity: Minor
      Found in resources/js/src/designer/move.ts - 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

      Function displayForm has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
      Open

          public function displayForm(
              UserPrivileges $userPrivileges,
              string $action,
              int $numFields = 0,
              array|null $selected = null,
      Severity: Minor
      Found in src/Table/ColumnsDefinition.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

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

      <?php
      /**
       * Functionality for the navigation tree
       */
      
      
      Severity: Major
      Found in src/Navigation/Nodes/NodeViewContainer.php and 1 other location - About 1 day to fix
      src/Navigation/Nodes/NodeTableContainer.php on lines 1..41

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

      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

      <?php
      /**
       * Functionality for the navigation tree
       */
      
      
      Severity: Major
      Found in src/Navigation/Nodes/NodeTableContainer.php and 1 other location - About 1 day to fix
      src/Navigation/Nodes/NodeViewContainer.php on lines 1..41

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

      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 indexes.ts has 581 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method get has 242 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function get(): array
            {
                $config = Config::getInstance();
                $defaultPageDatabase = './' . Util::getScriptNameForOption($config->settings['DefaultTabDatabase'], 'database');
                $defaultPageTable = './' . Util::getScriptNameForOption($config->settings['DefaultTabTable'], 'table');
        Severity: Major
        Found in src/Config/SpecialSchemaLinks.php - About 1 day to fix

          Function loadLogStatistics has 242 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function loadLogStatistics (opts) {
                  var logRequest = null;
          
                  if (! opts.removeVariables) {
                      opts.removeVariables = false;
          Severity: Major
          Found in resources/js/src/server/status/monitor.ts - About 1 day to fix

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

                validate: function () {
                    /**
                     * @var $elm a jQuery object containing the reference
                     *           to an element that is being validated
                     */
            Severity: Major
            Found in resources/js/src/database/events.ts and 2 other locations - About 1 day to fix
            resources/js/src/database/routines.ts on lines 42..74
            resources/js/src/triggers.ts on lines 31..63

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

            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 3 locations. Consider refactoring.
            Open

                validate: function () {
                    /**
                     * @var $elm a jQuery object containing the reference
                     *           to an element that is being validated
                     */
            Severity: Major
            Found in resources/js/src/database/routines.ts and 2 other locations - About 1 day to fix
            resources/js/src/database/events.ts on lines 32..64
            resources/js/src/triggers.ts on lines 31..63

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

            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 3 locations. Consider refactoring.
            Open

                validate: function () {
                    /**
                     * @var $elm a jQuery object containing the reference
                     *           to an element that is being validated
                     */
            Severity: Major
            Found in resources/js/src/triggers.ts and 2 other locations - About 1 day to fix
            resources/js/src/database/events.ts on lines 32..64
            resources/js/src/database/routines.ts on lines 42..74

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

            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

            class ConfigOptionXRefRole(XRefRole):
                """
                Cross-referencing role for configuration options (adds an index entry).
                """
            
            
            Severity: Major
            Found in docs/_ext/configext.py and 1 other location - About 1 day to fix
            docs/_ext/configext.py on lines 75..92

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

            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

            class ConfigSectionXRefRole(XRefRole):
                """
                Cross-referencing role for configuration sections (adds an index entry).
                """
            
            
            Severity: Major
            Found in docs/_ext/configext.py and 1 other location - About 1 day to fix
            docs/_ext/configext.py on lines 126..143

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

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

                public function displayForm(
                    UserPrivileges $userPrivileges,
                    string $action,
                    int $numFields = 0,
                    array|null $selected = null,
            Severity: Major
            Found in src/Table/ColumnsDefinition.php - About 1 day to fix

              File FormDisplay.php has 552 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Form management class, displays and processes forms
               *
               * Explanation of used terms:
              Severity: Major
              Found in src/Config/FormDisplay.php - About 1 day to fix

                Function onloadNavigation has 231 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function onloadNavigation () {
                    return function () {
                        if (! $('#pma_navigation').length) {
                            // Don't bother running any code if the navigation is not even on the page
                            return;
                Severity: Major
                Found in resources/js/src/modules/navigation/event-loader.ts - About 1 day to fix

                  File Pdf.php has 550 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * PhpMyAdmin\Plugins\Export\Helpers\Pdf class
                   */
                  
                  
                  Severity: Major
                  Found in src/Plugins/Export/Helpers/Pdf.php - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language