phpmyadmin/phpmyadmin

View on GitHub
resources/js/src/database/routines.ts

Summary

Maintainability
F
1 wk
Test Coverage

File routines.ts has 663 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 { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
Severity: Major
Found in resources/js/src/database/routines.ts - About 1 day to fix

    Function editorDialog has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        editorDialog: function (isNew, $this) {
            var that = this;
            /**
             * @var $edit_row jQuery object containing the reference to
             *                the row of the the item being edited
    Severity: Major
    Found in resources/js/src/database/routines.ts - About 5 hrs to fix

      Function executeDialog has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          executeDialog: function ($this) {
              /**
               * @var msg jQuery object containing the reference to
               *          the AJAX message shown to the user
               */
      Severity: Major
      Found in resources/js/src/database/routines.ts - About 3 hrs to fix

        Function click has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    buttonOptions[window.Messages.strGo].click = function () {
                        // Move the data from the codemirror editor back to the
                        // textarea, where it can be used in the form submission.
                        if (typeof window.CodeMirror !== 'undefined') {
                            that.syntaxHiglighter.save();
        Severity: Major
        Found in resources/js/src/database/routines.ts - About 2 hrs to fix

          Function exportDialog has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              exportDialog: function ($this) {
                  var $msg = ajaxShowMessage();
                  if ($this.attr('id') === 'bulkActionExportButton') {
                      var combined = {
                          success: true,
          Severity: Major
          Found in resources/js/src/database/routines.ts - About 2 hrs to fix

            Function validateCustom has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                validateCustom: function () {
                    /**
                     * @var isSuccess Stores the outcome of the validation
                     */
                    var isSuccess = true;
            Severity: Major
            Found in resources/js/src/database/routines.ts - About 2 hrs to fix

              Function setOptionsForParameter has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  setOptionsForParameter: function ($type, $len, $text, $num) {
                      /**
                       * @var no_opts a jQuery object containing the reference
                       *              to an element to be displayed when no
                       *              options are available
              Severity: Major
              Found in resources/js/src/database/routines.ts - About 2 hrs to fix

                Function dropMultipleDialog has 49 lines of code (exceeds 25 allowed). 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: Minor
                Found in resources/js/src/database/routines.ts - About 1 hr to fix

                  Function dropDialog has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      dropDialog: function ($this) {
                          /**
                           * @var $curr_row Object containing reference to the current row
                           */
                          var $currRow = $this.parents('tr');
                  Severity: Minor
                  Found in resources/js/src/database/routines.ts - About 1 hr to fix

                    Function validateCustom has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        validateCustom: function () {
                            /**
                             * @var isSuccess Stores the outcome of the validation
                             */
                            var isSuccess = true;
                    Severity: Minor
                    Found in resources/js/src/database/routines.ts - About 1 hr 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

                    Avoid too many return statements within this function.
                    Open

                            return true;
                    Severity: Major
                    Found in resources/js/src/database/routines.ts - About 30 mins to fix

                      Function setOptionsForParameter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          setOptionsForParameter: function ($type, $len, $text, $num) {
                              /**
                               * @var no_opts a jQuery object containing the reference
                               *              to an element to be displayed when no
                               *              options are available
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts - About 25 mins 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 exportDialog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          exportDialog: function ($this) {
                              var $msg = ajaxShowMessage();
                              if ($this.attr('id') === 'bulkActionExportButton') {
                                  var combined = {
                                      success: true,
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts - About 25 mins 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

                                  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

                              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

                      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

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

                                              $table.find('tr').has('td').each(function () {
                                                  rowclass = (ct % 2 === 1) ? 'odd' : 'even';
                                                  $(this).removeClass('odd even').addClass(rowclass);
                                                  ct++;
                                              });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 1 other location - About 2 hrs to fix
                      resources/js/src/database/routines.ts on lines 548..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 81.

                      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

                                                  $table.find('tr').has('td').each(function () {
                                                      rowclass = (ct % 2 === 1) ? 'odd' : 'even';
                                                      $(this).removeClass('odd even').addClass(rowclass);
                                                      ct++;
                                                  });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 1 other location - About 2 hrs to fix
                      resources/js/src/database/routines.ts on lines 467..471

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

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

                                  var buttonOptions = {
                                      [window.Messages.strGo]: {
                                          text: window.Messages.strGo,
                                          class: 'btn btn-primary',
                                      },
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 4 other locations - About 1 hr to fix
                      resources/js/src/server/status/monitor.ts on lines 697..706
                      resources/js/src/server/status/monitor.ts on lines 1487..1496
                      resources/js/src/server/status/monitor.ts on lines 2223..2232
                      resources/js/src/triggers.ts on lines 188..197

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

                      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

                          $(document).on('change', 'select[name=item_type]', function () {
                              $(this).closest('table').find('tr.routine_return_row, .routine_direction_cell').toggle();
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 2 other locations - About 50 mins to fix
                      resources/js/src/database/events.ts on lines 633..635
                      resources/js/src/drag_drop_import.ts on lines 388..390

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

                      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

                              case 'ENUM':
                                  $text.parent().show();
                                  $num.parent().hide();
                                  $noOpts.hide();
                                  break;
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts and 1 other location - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 779..783

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

                      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

                              case 'REAL':
                                  $text.parent().hide();
                                  $num.parent().show();
                                  $noOpts.hide();
                                  break;
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts and 1 other location - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 791..795

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

                      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

                                  buttonOptions[window.Messages.strClose].click = function () {
                                      $(this).dialog('close');
                                  };
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts and 2 other locations - About 40 mins to fix
                      resources/js/src/database/events.ts on lines 325..327
                      resources/js/src/triggers.ts on lines 334..336

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

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

                          $(document).on('click', 'a.ajax.exec_anchor', function (event) {
                              event.preventDefault();
                              DatabaseRoutines.executeDialog($(this));
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 5 other locations - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 972..975
                      resources/js/src/database/routines.ts on lines 977..980
                      resources/js/src/database/routines.ts on lines 982..985
                      resources/js/src/database/routines.ts on lines 987..990
                      resources/js/src/triggers.ts on lines 599..602

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

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

                          $(document).on('click', '#bulkActionExportButton', function (event) {
                              event.preventDefault();
                              DatabaseRoutines.exportDialog($(this));
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 5 other locations - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 967..970
                      resources/js/src/database/routines.ts on lines 972..975
                      resources/js/src/database/routines.ts on lines 982..985
                      resources/js/src/database/routines.ts on lines 987..990
                      resources/js/src/triggers.ts on lines 599..602

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

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

                          $(document).on('click', 'a.ajax.export_anchor', function (event) {
                              event.preventDefault();
                              DatabaseRoutines.exportDialog($(this));
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 5 other locations - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 967..970
                      resources/js/src/database/routines.ts on lines 977..980
                      resources/js/src/database/routines.ts on lines 982..985
                      resources/js/src/database/routines.ts on lines 987..990
                      resources/js/src/triggers.ts on lines 599..602

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

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

                          $(document).on('click', 'a.ajax.drop_anchor', function (event) {
                              event.preventDefault();
                              DatabaseRoutines.dropDialog($(this));
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 5 other locations - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 967..970
                      resources/js/src/database/routines.ts on lines 972..975
                      resources/js/src/database/routines.ts on lines 977..980
                      resources/js/src/database/routines.ts on lines 987..990
                      resources/js/src/triggers.ts on lines 599..602

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

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

                          $(document).on('click', '#bulkActionDropButton', function (event) {
                              event.preventDefault();
                              DatabaseRoutines.dropMultipleDialog($(this));
                          });
                      Severity: Major
                      Found in resources/js/src/database/routines.ts and 5 other locations - About 40 mins to fix
                      resources/js/src/database/routines.ts on lines 967..970
                      resources/js/src/database/routines.ts on lines 972..975
                      resources/js/src/database/routines.ts on lines 977..980
                      resources/js/src/database/routines.ts on lines 982..985
                      resources/js/src/triggers.ts on lines 599..602

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

                      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

                              DatabaseRoutines.setOptionsForParameter(
                                  $row.find('select[name^=item_param_type]'),
                                  $row.find('input[name^=item_param_length]'),
                                  $row.find('select[name^=item_param_opts_text]'),
                                  $row.find('select[name^=item_param_opts_num]')
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts and 1 other location - About 35 mins to fix
                      resources/js/src/database/routines.ts on lines 1008..1013

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

                      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

                              DatabaseRoutines.setOptionsForParameter(
                                  $table.find('select[name=item_returntype]'),
                                  $table.find('input[name=item_returnlength]'),
                                  $table.find('select[name=item_returnopts_text]'),
                                  $table.find('select[name=item_returnopts_num]')
                      Severity: Minor
                      Found in resources/js/src/database/routines.ts and 1 other location - About 35 mins to fix
                      resources/js/src/database/routines.ts on lines 998..1003

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

                      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

                      There are no issues that match your filters.

                      Category
                      Status