phpmyadmin/phpmyadmin

View on GitHub

Showing 2,003 of 2,003 total issues

Function showCurrent has 176 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function showCurrent (): void {
    var db = CommonParams.get('db');
    var table = CommonParams.get('table');

    var autoexpand = $('#pma_navigation_tree').hasClass('autoexpand');
Severity: Major
Found in resources/js/src/modules/navigation.ts - About 7 hrs to fix

    File Common.php has 457 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    namespace PhpMyAdmin\Database\Designer;
    Severity: Minor
    Found in src/Database/Designer/Common.php - About 7 hrs to fix

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

                  if (xChange) {
                      xCord[searchedDataKey] = selectedRow[xLabel];
                      // [searchedDataKey][0] contains the x value
                      if (xType === 'numeric') {
                          series[0][searchedDataKey][0] = selectedRow[xLabel];
      Severity: Major
      Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 6 hrs to fix
      resources/js/src/table/zoom_plot_jqplot.ts on lines 354..370

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

      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

                  if (yChange) {
                      yCord[searchedDataKey] = selectedRow[yLabel];
                      // [searchedDataKey][1] contains the y value
                      if (yType === 'numeric') {
                          series[0][searchedDataKey][1] = selectedRow[yLabel];
      Severity: Major
      Found in resources/js/src/table/zoom_plot_jqplot.ts and 1 other location - About 6 hrs to fix
      resources/js/src/table/zoom_plot_jqplot.ts on lines 336..352

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

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

      import $ from 'jquery';
      import { AJAX } from '../modules/ajax.ts';
      import { escapeHtml } from '../modules/functions/escape.ts';
      
      let openLayersData: any[]|null = null;
      Severity: Minor
      Found in resources/js/src/table/gis_visualization.ts - About 6 hrs to fix

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

        function makeMultiPolygonInputs (prefix: string, data): string {
            const d = data || [];
            const inputs = [];
            let i = 0;
            while (d[i] || i < 1) {
        Severity: Major
        Found in resources/js/src/gis_data_editor.ts and 1 other location - About 6 hrs to fix
        resources/js/src/gis_data_editor.ts on lines 124..146

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

        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 makeMultiLineStringInputs (prefix: string, data): string {
            const d = data || [];
            const inputs = [];
            let i = 0;
            while (d[i] || i < 1) {
        Severity: Major
        Found in resources/js/src/gis_data_editor.ts and 1 other location - About 6 hrs to fix
        resources/js/src/gis_data_editor.ts on lines 172..194

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

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

        <?php
        /**
         * Set of methods used to build dumps of tables as Latex
         */
        
        
        Severity: Minor
        Found in src/Plugins/Export/ExportLatex.php - About 6 hrs to fix

          File Tracker.php has 441 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Tracking changes on databases, tables and views
           */
          
          
          Severity: Minor
          Found in src/Tracking/Tracker.php - About 6 hrs to fix

            Method getFunctionsClass has 163 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getFunctionsClass(string $class): array
                {
                    $isMariaDB = $this->dbi->isMariaDB();
                    $serverVersion = $this->dbi->getVersion();
            
            
            Severity: Major
            Found in src/Types.php - About 6 hrs to fix

              File AuthenticationCookie.php has 437 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Cookie Authentication plugin for phpMyAdmin
               */
              
              
              Severity: Minor
              Found in src/Plugins/Auth/AuthenticationCookie.php - About 6 hrs to fix

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

                    $('body').on('click', 'a.delete_entry_anchor.ajax', function (e) {
                        e.preventDefault();
                        var $anchor = $(this);
                        var question = window.Messages.strDeletingTrackingEntry;
                        $anchor.confirm(question, $anchor.attr('href'), function (url) {
                Severity: Major
                Found in resources/js/src/table/tracking.ts and 1 other location - About 6 hrs to fix
                resources/js/src/table/tracking.ts on lines 82..94

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

                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

                    $('body').on('click', 'a.delete_version_anchor.ajax', function (e) {
                        e.preventDefault();
                        var $anchor = $(this);
                        var question = window.Messages.strDeleteTrackingVersion;
                        $anchor.confirm(question, $anchor.attr('href'), function (url) {
                Severity: Major
                Found in resources/js/src/table/tracking.ts and 1 other location - About 6 hrs to fix
                resources/js/src/table/tracking.ts on lines 99..111

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

                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

                AJAX.registerOnload('transformations/json.js', function () {
                    var $elm = $('#page_content').find('code.json');
                    $elm.each(function () {
                        var $json = $(this);
                        var $pre = $json.find('pre');
                Severity: Major
                Found in resources/js/src/transformations/json.ts and 1 other location - About 6 hrs to fix
                resources/js/src/transformations/xml.ts on lines 7..21

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

                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

                AJAX.registerOnload('transformations/xml.js', function () {
                    var $elm = $('#page_content').find('code.xml');
                    $elm.each(function () {
                        var $json = $(this);
                        var $pre = $json.find('pre');
                Severity: Major
                Found in resources/js/src/transformations/xml.ts and 1 other location - About 6 hrs to fix
                resources/js/src/transformations/json.ts on lines 7..21

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

                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

                Function addNewContinueInsertionFields has 159 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function addNewContinueInsertionFields (event) {
                    event.preventDefault();
                    /**
                     * @var columnCount   Number of number of columns table has.
                     */
                Severity: Major
                Found in resources/js/src/table/change.ts - About 6 hrs to fix

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

                  <?php
                  
                  declare(strict_types=1);
                  
                  namespace PhpMyAdmin\Identifiers;
                  Severity: Major
                  Found in src/Identifiers/DatabaseName.php and 2 other locations - About 6 hrs to fix
                  src/Identifiers/TableName.php on lines 1..76
                  src/Identifiers/TriggerName.php on lines 1..76

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

                  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

                              foreach ($data as $col => $txt) {
                                  $this->page = $currpage;
                                  $this->setXY($l, $h);
                                  if ($this->tablewidths[$col] > 0) {
                                      $this->MultiCell(
                  Severity: Major
                  Found in src/Plugins/Export/Helpers/Pdf.php and 1 other location - About 6 hrs to fix
                  src/Plugins/Export/Helpers/Pdf.php on lines 597..625

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

                  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

                              foreach ($data as $col => $txt) {
                                  $this->page = $currpage;
                                  $this->setXY($l, $h);
                                  if ($this->tablewidths[$col] > 0) {
                                      $this->MultiCell(
                  Severity: Major
                  Found in src/Plugins/Export/Helpers/Pdf.php and 1 other location - About 6 hrs to fix
                  src/Plugins/Export/Helpers/Pdf.php on lines 374..402

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

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

                  <?php
                  
                  declare(strict_types=1);
                  
                  namespace PhpMyAdmin\Identifiers;
                  Severity: Major
                  Found in src/Identifiers/TableName.php and 2 other locations - About 6 hrs to fix
                  src/Identifiers/DatabaseName.php on lines 1..76
                  src/Identifiers/TriggerName.php on lines 1..76

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language