phpmyadmin/phpmyadmin

View on GitHub
resources/js/src/modules/console.ts

Summary

Maintainability
F
1 wk
Test Coverage

File console.ts has 1187 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import $ from 'jquery';
import CodeMirror from 'codemirror';
import { AJAX } from './ajax.ts';
import { Functions } from './functions.ts';
import { CommonParams } from './common.ts';
Severity: Major
Found in resources/js/src/modules/console.ts - About 3 days to fix

    Function showLog has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        showLog: function (debugInfo, url = undefined) {
            this.lastDebugInfo.debugInfo = debugInfo;
            this.lastDebugInfo.url = url;
    
            $('#debug_console').find('.debugLog').empty();
    Severity: Minor
    Found in resources/js/src/modules/console.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 setupAfterInit has 140 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setupAfterInit: function () {
            Console.isEnabled = true;
    
            // Vars init
            Console.$consoleToolbar = $('#pma_console').find('>.toolbar');
    Severity: Major
    Found in resources/js/src/modules/console.ts - About 5 hrs to fix

      Function showLog has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          showLog: function (debugInfo, url = undefined) {
              this.lastDebugInfo.debugInfo = debugInfo;
              this.lastDebugInfo.url = url;
      
              $('#debug_console').find('.debugLog').empty();
      Severity: Major
      Found in resources/js/src/modules/console.ts - About 4 hrs to fix

        Function messageEventBinds has 107 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            messageEventBinds: function ($target) {
                // Leave unbinded elements, remove binded.
                var $targetMessage = $target.filter(':not(.binded)');
                if ($targetMessage.length === 0) {
                    return;
        Severity: Major
        Found in resources/js/src/modules/console.ts - About 4 hrs to fix

          Function historyNavigate has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              historyNavigate: function (event) {
                  if (event.keyCode === 38 || event.keyCode === 40) {
                      var upPermitted = false;
                      var downPermitted = false;
                      var editor = ConsoleInput.inputs.console;
          Severity: Minor
          Found in resources/js/src/modules/console.ts - About 3 hrs 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 initialize has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              initialize: function () {
                  // Try to get debug info after every AJAX request
                  $(document).on('ajaxSuccess', function (event, xhr, settings, data) {
                      if (data.debug) {
                          ConsoleDebug.showLog(data.debug, settings.url);
          Severity: Major
          Found in resources/js/src/modules/console.ts - About 2 hrs to fix

            Function formatBackTrace has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                formatBackTrace: function (dbgTrace) {
                    var $traceElem = $('<div class="trace">');
                    $traceElem.append(
                        $('<div class="message welcome">')
                    );
            Severity: Major
            Found in resources/js/src/modules/console.ts - About 2 hrs to fix

              Function initialize has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initialize: function (): void {
                      // _cm object can't be reinitialize
                      if (ConsoleInput.inputs !== null) {
                          return;
                      }
              Severity: Minor
              Found in resources/js/src/modules/console.ts - About 1 hr to fix

                Function historyNavigate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    historyNavigate: function (event) {
                        if (event.keyCode === 38 || event.keyCode === 40) {
                            var upPermitted = false;
                            var downPermitted = false;
                            var editor = ConsoleInput.inputs.console;
                Severity: Minor
                Found in resources/js/src/modules/console.ts - About 1 hr to fix

                  Function formatBackTrace has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      formatBackTrace: function (dbgTrace) {
                          var $traceElem = $('<div class="trace">');
                          $traceElem.append(
                              $('<div class="message welcome">')
                          );
                  Severity: Minor
                  Found in resources/js/src/modules/console.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

                  Function updateQuery has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      updateQuery: function (msgId, isSuccessed, queryData) {
                          var $targetMessage = $('#pma_console').find('.console_message_container .message[msgid=' + parseInt(msgId) + ']');
                          if ($targetMessage.length === 0 || isNaN(parseInt(msgId))) {
                              return false;
                          }
                  Severity: Minor
                  Found in resources/js/src/modules/console.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

                  Function execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      execute: function (queryString, options = undefined): void {
                          if (typeof (queryString) !== 'string' || ! /[a-z]|[A-Z]/.test(queryString)) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in resources/js/src/modules/console.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

                  Function initialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      initialize: function (): void {
                          if ($('#pma_bookmarks').length === 0) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in resources/js/src/modules/console.ts - About 1 hr to fix

                    Function formatQueryOrGroup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        formatQueryOrGroup: function (queryInfo, totalTime) {
                            var grouped;
                            var queryText;
                            var queryTime;
                            var count;
                    Severity: Minor
                    Found in resources/js/src/modules/console.ts - About 1 hr to fix

                      Function append has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          append: function (msgString, msgType) {
                              if (typeof (msgString) !== 'string') {
                                  return false;
                              }
                      
                      
                      Severity: Minor
                      Found in resources/js/src/modules/console.ts - About 1 hr to fix

                        Function execute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            execute: function (queryString, options = undefined): void {
                                if (typeof (queryString) !== 'string' || ! /[a-z]|[A-Z]/.test(queryString)) {
                                    return;
                                }
                        
                        
                        Severity: Minor
                        Found in resources/js/src/modules/console.ts - About 1 hr to fix

                          Function ajaxCallback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              ajaxCallback: function (data) {
                                  if (data && data.console_message_id) {
                                      ConsoleMessages.updateQuery(data.console_message_id, data.success,
                                          (data.reloadQuerywindow ? data.reloadQuerywindow : false));
                                  } else if (data && data.reloadQuerywindow) {
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts - About 55 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              initialize: function (): void {
                                  // _cm object can't be reinitialize
                                  if (ConsoleInput.inputs !== null) {
                                      return;
                                  }
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts - About 45 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 keyDown has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              keyDown: function (event): void {
                                  // Execute command
                                  if (config.enterExecutes) {
                                      // Enter, but not in combination with Shift (which writes a new line).
                                      if (! event.shiftKey && event.keyCode === 13) {
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts - About 45 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 showCard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              showCard: function (cardSelector): void {
                                  var $card = null;
                                  if (typeof (cardSelector) !== 'string') {
                                      if (cardSelector.length > 0) {
                                          $card = cardSelector;
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts - About 35 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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              initialize: function () {
                                  // Try to get debug info after every AJAX request
                                  $(document).on('ajaxSuccess', function (event, xhr, settings, data) {
                                      if (data.debug) {
                                          ConsoleDebug.showLog(data.debug, settings.url);
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts - About 35 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 setText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              setText: function (text, target = undefined): void {
                                  if (ConsoleInput.codeMirror) {
                                      switch (target) {
                                      case 'bookmark':
                                          Console.execute(ConsoleInput.inputs.bookmark.setValue(text));
                          Severity: Minor
                          Found in resources/js/src/modules/console.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 append has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              append: function (msgString, msgType) {
                                  if (typeof (msgString) !== 'string') {
                                      return false;
                                  }
                          
                          
                          Severity: Minor
                          Found in resources/js/src/modules/console.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 mouseMove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              mouseMove: function (event): void {
                                  if (event.pageY < 35) {
                                      event.pageY = 35;
                                  }
                          
                          
                          Severity: Minor
                          Found in resources/js/src/modules/console.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 getText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getText: function (target = undefined) {
                                  if (ConsoleInput.codeMirror) {
                                      switch (target) {
                                      case 'bookmark':
                                          return ConsoleInput.inputs.bookmark.getValue();
                          Severity: Minor
                          Found in resources/js/src/modules/console.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

                                  $('#debug_console').find('.button.ungroup_queries').on('click', function () {
                                      $('#debug_console').addClass('ungrouped');
                                      $('#debug_console').removeClass('grouped');
                                      config.setGroupQueries(false);
                                      ConsoleDebug.refresh();
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 4 hrs to fix
                          resources/js/src/modules/console.ts on lines 1199..1207

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

                          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

                                  $('#debug_console').find('.button.group_queries').on('click', function () {
                                      $('#debug_console').addClass('grouped');
                                      $('#debug_console').removeClass('ungrouped');
                                      config.setGroupQueries(true);
                                      ConsoleDebug.refresh();
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 4 hrs to fix
                          resources/js/src/modules/console.ts on lines 1209..1217

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

                          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

                                      ConsoleInput.inputs.console = CodeMirror($('#pma_console').find('.console_query_input')[0], {
                                          // style: cm-s-pma
                                          theme: 'pma',
                                          mode: 'text/x-sql',
                                          lineWrapping: true,
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 3 hrs to fix
                          resources/js/src/modules/console.ts on lines 555..569

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

                          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

                                          ConsoleInput.inputs.bookmark = CodeMirror($('#pma_console').find('.bookmark_add_input')[0], {
                                              // style: cm-s-pma
                                              theme: 'pma',
                                              mode: 'text/x-sql',
                                              lineWrapping: true,
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 3 hrs to fix
                          resources/js/src/modules/console.ts on lines 532..546

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

                          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 (ConsoleInput.codeMirror) {
                                      switch (target) {
                                      case 'bookmark':
                                          Console.execute(ConsoleInput.inputs.bookmark.setValue(text));
                                          break;
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 731..740

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

                          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

                                  } else {
                                      switch (target) {
                                      case 'bookmark':
                                          Console.execute(ConsoleInput.inputs.bookmark.val(text));
                                          break;
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 722..731

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

                          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

                                  $targetMessage.find('.action.expand').on('click', function () {
                                      $(this).closest('.message').removeClass('collapsed');
                                      $(this).closest('.message').addClass('expanded');
                                  });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 915..918

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

                          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

                                  $targetMessage.find('.action.collapse').on('click', function () {
                                      $(this).closest('.message').addClass('collapsed');
                                      $(this).closest('.message').removeClass('expanded');
                                  });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 1 other location - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 910..913

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

                          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

                                  $targetMessage.find('.action.dbg_show_args').on('click', function () {
                                      var $message = $(this).closest('.message');
                                      $message.addClass('show_args expanded');
                                      $message.removeClass('hide_args collapsed');
                                  });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 1002..1006
                          resources/js/src/modules/console.ts on lines 1014..1018

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

                          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

                                  $targetMessage.find('.action.dbg_hide_trace').on('click', function () {
                                      var $message = $(this).closest('.message');
                                      $message.addClass('hide_trace');
                                      $message.removeClass('show_trace');
                                  });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 1008..1012
                          resources/js/src/modules/console.ts on lines 1014..1018

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

                          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

                                  $targetMessage.find('.action.dbg_hide_args').on('click', function () {
                                      var $message = $(this).closest('.message');
                                      $message.addClass('hide_args collapsed');
                                      $message.removeClass('show_args expanded');
                                  });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 1 hr to fix
                          resources/js/src/modules/console.ts on lines 1002..1006
                          resources/js/src/modules/console.ts on lines 1008..1012

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

                          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

                                      if ($this.hasClass('order_asc')) {
                                          config.setOrder('asc');
                                      } else if ($this.hasClass('order_desc')) {
                                          config.setOrder('desc');
                                      }
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 55 mins to fix
                          resources/js/src/makegrid.ts on lines 1336..1340
                          resources/js/src/modules/console.ts on lines 1225..1229

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

                          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

                                      } else if ($this.hasClass('sort_exec')) {
                                          config.setOrderBy('exec');
                                      } else if ($this.hasClass('sort_count')) {
                                          config.setOrderBy('count');
                                      }
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 55 mins to fix
                          resources/js/src/makegrid.ts on lines 1336..1340
                          resources/js/src/modules/console.ts on lines 1238..1242

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

                          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 (ConsoleInput.codeMirror) {
                                      switch (target) {
                                      case 'bookmark':
                                          return ConsoleInput.inputs.bookmark.getValue();
                                      default:
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts and 1 other location - About 55 mins to fix
                          resources/js/src/modules/console.ts on lines 755..763

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

                          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

                                  } else {
                                      switch (target) {
                                      case 'bookmark':
                                          return ConsoleInput.inputs.bookmark.val();
                                      default:
                          Severity: Minor
                          Found in resources/js/src/modules/console.ts and 1 other location - About 55 mins to fix
                          resources/js/src/modules/console.ts on lines 747..755

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

                          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

                                      $('#pma_bookmarks').find('.switch_button').on('click', function () {
                                          Console.hideCard($(this).closest('.card'));
                                      });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 50 mins to fix
                          resources/js/src/modules/console.ts on lines 139..141
                          resources/js/src/modules/console.ts on lines 147..149

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

                          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

                                      $('#pma_console_options').find('.switch_button').on('click', function () {
                                          Console.hideCard($(this).closest('.card'));
                                      });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 50 mins to fix
                          resources/js/src/modules/console.ts on lines 139..141
                          resources/js/src/modules/console.ts on lines 143..145

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

                          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

                                      $('#debug_console').find('.switch_button').on('click', function () {
                                          Console.hideCard($(this).closest('.card'));
                                      });
                          Severity: Major
                          Found in resources/js/src/modules/console.ts and 2 other locations - About 50 mins to fix
                          resources/js/src/modules/console.ts on lines 143..145
                          resources/js/src/modules/console.ts on lines 147..149

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

                          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