phpmyadmin/phpmyadmin

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

Summary

Maintainability
F
3 wks
Test Coverage

File functions.ts has 2661 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

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

      Function sqlPrettyPrint has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

      function sqlPrettyPrint (string) {
          if (typeof window.CodeMirror === 'undefined') {
              return string;
          }
      
      
      Severity: Minor
      Found in resources/js/src/modules/functions.ts - About 7 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 codeMirrorAutoCompleteOnInputRead has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      function codeMirrorAutoCompleteOnInputRead (instance) {
          if (! sqlAutoCompleteInProgress
              && (! instance.options.hintOptions.tables || ! sqlAutoComplete)) {
              if (! sqlAutoComplete) {
                  // Reset after teardown
      Severity: Minor
      Found in resources/js/src/modules/functions.ts - About 4 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 onloadCreateTableEvents has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function onloadCreateTableEvents (): void {
          /**
           * Attach event handler for submission of create table form (save)
           */
          $(document).on('submit', 'form.create_table_form.ajax', function (event) {
      Severity: Major
      Found in resources/js/src/modules/functions.ts - About 4 hrs to fix

        Function onloadIdleEvent has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function onloadIdleEvent () {
            document.onclick = function () {
                idleSecondsCounter = 0;
            };
        
        
        Severity: Minor
        Found in resources/js/src/modules/functions.ts - About 4 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 sqlPrettyPrint has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function sqlPrettyPrint (string) {
            if (typeof window.CodeMirror === 'undefined') {
                return string;
            }
        
        
        Severity: Major
        Found in resources/js/src/modules/functions.ts - About 4 hrs to fix

          Function onloadChangePasswordEvents has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function onloadChangePasswordEvents (): void {
              /* Handler for hostname type */
              $(document).on('change', '#select_pred_hostname', function () {
                  var hostname = $('#pma_hostname');
                  if (this.value === 'any') {
          Severity: Major
          Found in resources/js/src/modules/functions.ts - About 4 hrs to fix

            Function onloadIdleEvent has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function onloadIdleEvent () {
                document.onclick = function () {
                    idleSecondsCounter = 0;
                };
            
            
            Severity: Major
            Found in resources/js/src/modules/functions.ts - About 3 hrs to fix

              Function indexDialogModal has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function indexDialogModal (routeUrl, url, title, callbackSuccess, callbackFailure = undefined) {
                  /* Remove the hidden dialogs if there are*/
                  var modal = $('#indexDialogModal');
              
                  const indexDialogPreviewModal = document.getElementById('indexDialogPreviewModal');
              Severity: Major
              Found in resources/js/src/modules/functions.ts - About 3 hrs to fix

                Function toggleButton has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function toggleButton ($obj) {
                    // In rtl mode the toggle switch is flipped horizontally
                    // so we need to take that into account
                    var right;
                    if ($('span.text_direction', $obj).text() === 'ltr') {
                Severity: Major
                Found in resources/js/src/modules/functions.ts - About 3 hrs to fix

                  Function codeMirrorAutoCompleteOnInputRead has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function codeMirrorAutoCompleteOnInputRead (instance) {
                      if (! sqlAutoCompleteInProgress
                          && (! instance.options.hintOptions.tables || ! sqlAutoComplete)) {
                          if (! sqlAutoComplete) {
                              // Reset after teardown
                  Severity: Major
                  Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

                    Function addDatepicker has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addDatepicker ($thisElement, type = undefined, options = undefined) {
                        if (type !== 'date' && type !== 'time' && type !== 'datetime' && type !== 'timestamp') {
                            return;
                        }
                    
                    
                    Severity: Major
                    Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

                      Function slidingMessage has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function slidingMessage (msg, $object = undefined) {
                          var $obj = $object;
                          if (msg === undefined || msg.length === 0) {
                              // Don't show an empty message
                              return false;
                      Severity: Major
                      Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

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

                        function onloadSqlQueryEditEvents () {
                            // If we are coming back to the page by clicking forward button
                            // of the browser, bind the code mirror to inline query editor.
                            Functions.bindCodeMirrorToInlineEditor();
                            $(document).on('click', 'a.inline_edit_sql', function () {
                        Severity: Major
                        Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

                          Function getCheckAllCheckboxEventHandler has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getCheckAllCheckboxEventHandler () {
                              return function (e) {
                                  var $this = $(this);
                                  var $tr = $this.closest('tr');
                                  var $table = $this.closest('table');
                          Severity: Major
                          Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

                            Function UpdateIdleTime has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function UpdateIdleTime () {
                                    var href = 'index.php?route=/';
                                    var guid = 'default';
                                    if (isStorageSupported('sessionStorage')) {
                                        guid = window.sessionStorage.guid;
                            Severity: Major
                            Found in resources/js/src/modules/functions.ts - About 2 hrs to fix

                              Function showIndexEditDialog has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function showIndexEditDialog ($outer) {
                                  checkIndexType();
                                  checkIndexName('index_frm');
                                  var $indexColumns = $('#index_columns');
                                  $indexColumns.find('tbody').sortable({
                              Severity: Minor
                              Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                Function autoPopulate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function autoPopulate (inputId, offset) {
                                    var db = CommonParams.get('db');
                                    var table = CommonParams.get('table');
                                    var newInputId = inputId.substring(0, inputId.length - 1);
                                    $('#' + newInputId + '1').val(window.centralColumnList[db + '_' + table][offset].col_name);
                                Severity: Minor
                                Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                  Function checkTableEditForm has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function checkTableEditForm (theForm, fieldsCnt) {
                                      // TODO: avoid sending a message if user just wants to add a line
                                      // on the form but has not completed at least one field name
                                  
                                      var atLeastOneField = 0;
                                  Severity: Minor
                                  Found in resources/js/src/modules/functions.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 dismissNotifications has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function dismissNotifications () {
                                      return function () {
                                          /**
                                           * Allows the user to dismiss a notification
                                           * created with ajaxShowMessage()
                                  Severity: Minor
                                  Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                    Function checkTableEditForm has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function checkTableEditForm (theForm, fieldsCnt) {
                                        // TODO: avoid sending a message if user just wants to add a line
                                        // on the form but has not completed at least one field name
                                    
                                        var atLeastOneField = 0;
                                    Severity: Minor
                                    Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                      Function getSqlEditor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function getSqlEditor ($textarea, options = undefined, resize = undefined, lintOptions = undefined): CodeMirror.EditorFromTextArea | null {
                                          if ($textarea.length === 0 || typeof window.CodeMirror === 'undefined') {
                                              return null;
                                          }
                                      
                                      
                                      Severity: Minor
                                      Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                    open: function () {
                                                        $('#col_list').on('click', '.pick', function () {
                                                            $centralColumnsDialog.remove();
                                                        });
                                        
                                        
                                        Severity: Minor
                                        Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                          function addDateTimePicker () {
                                              if ($.timepicker === undefined) {
                                                  return;
                                              }
                                          
                                          
                                          Severity: Minor
                                          Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                            function autoPopulate (inputId, offset) {
                                                var db = CommonParams.get('db');
                                                var table = CommonParams.get('table');
                                                var newInputId = inputId.substring(0, inputId.length - 1);
                                                $('#' + newInputId + '1').val(window.centralColumnList[db + '_' + table][offset].col_name);
                                            Severity: Minor
                                            Found in resources/js/src/modules/functions.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 checkPasswordStrength has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            function checkPasswordStrength (value, meterObject, meterObjectLabel, username) {
                                                // List of words we don't want to appear in the password
                                                var customDict = [
                                                    'phpmyadmin',
                                                    'mariadb',
                                            Severity: Minor
                                            Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                              Function success has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                          success: function (data) {
                                                              if (data.success) {
                                                                  if (CommonParams.get('LoginCookieValidity') - idleSecondsCounter < 0) {
                                                                      /* There is other active window, let's reset counter */
                                                                      idleSecondsCounter = 0;
                                              Severity: Minor
                                              Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                Function addDatepicker has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                function addDatepicker ($thisElement, type = undefined, options = undefined) {
                                                    if (type !== 'date' && type !== 'time' && type !== 'datetime' && type !== 'timestamp') {
                                                        return;
                                                    }
                                                
                                                
                                                Severity: Minor
                                                Found in resources/js/src/modules/functions.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 checkSqlQuery has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                function checkSqlQuery (theForm) {
                                                    // get the textarea element containing the query
                                                    var sqlQuery;
                                                    if (window.codeMirrorEditor) {
                                                        window.codeMirrorEditor.save();
                                                Severity: Minor
                                                Found in resources/js/src/modules/functions.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 getAddIndexEventHandler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                function getAddIndexEventHandler () {
                                                    return function (event) {
                                                        event.preventDefault();
                                                        var hadAddButtonHidden = $(this).closest('.card-body').find('.add_fields').hasClass('hide');
                                                        if (hadAddButtonHidden === false) {
                                                Severity: Minor
                                                Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                  Function updateQueryParameters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                  function updateQueryParameters () {
                                                      if (! $('#parameterized').is(':checked')) {
                                                          $('#parametersDiv').empty();
                                                  
                                                          return;
                                                  Severity: Minor
                                                  Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                    Function displayPasswordGenerateButton has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    function displayPasswordGenerateButton () {
                                                        var generatePwdRow = $('<tr></tr>').addClass('align-middle');
                                                        $('<td></td>').html(window.Messages.strGeneratePassword).appendTo(generatePwdRow);
                                                        var pwdCell = $('<td colspan="2"></td>').addClass('row').appendTo(generatePwdRow);
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                      Function checkSqlQuery has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      function checkSqlQuery (theForm) {
                                                          // get the textarea element containing the query
                                                          var sqlQuery;
                                                          if (window.codeMirrorEditor) {
                                                              window.codeMirrorEditor.save();
                                                      Severity: Minor
                                                      Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                        Function confirmQuery has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        function confirmQuery (theForm1, sqlQuery1) {
                                                            // Confirmation is not required in the configuration file
                                                            if (window.Messages.strDoYouReally === '') {
                                                                return true;
                                                            }
                                                        Severity: Minor
                                                        Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                          function updateCode ($base, htmlValue, rawValue) {
                                                              var $code = $base.find('code');
                                                              if ($code.length === 0) {
                                                                  return false;
                                                              }
                                                          Severity: Minor
                                                          Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                            function previewSql ($form): void {
                                                                var formUrl = $form.attr('action');
                                                                var sep = CommonParams.get('arg_separator');
                                                                var formData = $form.serialize() +
                                                                    sep + 'do_save_data=1' +
                                                            Severity: Minor
                                                            Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                              function suggestPassword (passwordForm) {
                                                                  // restrict the password to just letters and numbers to avoid problems:
                                                                  // "editors and viewers regard the password as multiple words and
                                                                  // things like double click no longer work"
                                                                  var pwchars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ@!_.*/()[]-';
                                                              Severity: Minor
                                                              Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                                function onloadRecentFavoriteTables (): void {
                                                                    // Sync favorite tables from localStorage to pmadb.
                                                                    if (! $('#sync_favorite_tables').length) {
                                                                        return;
                                                                    }
                                                                Severity: Minor
                                                                Found in resources/js/src/modules/functions.ts - About 1 hr to fix

                                                                  Function success has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                                  success: function (data) {
                                                                                      if (data.success) {
                                                                                          var tables = data.tables;
                                                                                          sqlAutoCompleteDefaultTable = CommonParams.get('table');
                                                                                          sqlAutoComplete = [];
                                                                  Severity: Minor
                                                                  Found in resources/js/src/modules/functions.ts - About 1 hr to fix

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

                                                                    function checkPassword ($theForm) {
                                                                        // Did the user select 'no password'?
                                                                        if ($theForm.find('#nopass_1').is(':checked')) {
                                                                            return true;
                                                                        } else {
                                                                    Severity: Minor
                                                                    Found in resources/js/src/modules/functions.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

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                                if (tables.hasOwnProperty(table)) {
                                                                                                    var columns = tables[table];
                                                                                                    // @ts-ignore
                                                                                                    table = {
                                                                                                        text: table,
                                                                    Severity: Major
                                                                    Found in resources/js/src/modules/functions.ts - About 45 mins to fix

                                                                      Function confirmQuery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                      function confirmQuery (theForm1, sqlQuery1) {
                                                                          // Confirmation is not required in the configuration file
                                                                          if (window.Messages.strDoYouReally === '') {
                                                                              return true;
                                                                          }
                                                                      Severity: Minor
                                                                      Found in resources/js/src/modules/functions.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 indexDialogModal has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                      function indexDialogModal (routeUrl, url, title, callbackSuccess, callbackFailure = undefined) {
                                                                      Severity: Minor
                                                                      Found in resources/js/src/modules/functions.ts - About 35 mins to fix

                                                                        Function checkFormElementInRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                        function checkFormElementInRange (theForm, theFieldName, message, minimum = undefined, maximum = undefined) {
                                                                        Severity: Minor
                                                                        Found in resources/js/src/modules/functions.ts - About 35 mins to fix

                                                                          Function slidingMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function slidingMessage (msg, $object = undefined) {
                                                                              var $obj = $object;
                                                                              if (msg === undefined || msg.length === 0) {
                                                                                  // Don't show an empty message
                                                                                  return false;
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 suggestPassword has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function suggestPassword (passwordForm) {
                                                                              // restrict the password to just letters and numbers to avoid problems:
                                                                              // "editors and viewers regard the password as multiple words and
                                                                              // things like double click no longer work"
                                                                              var pwchars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ@!_.*/()[]-';
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 clearSelection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function clearSelection () {
                                                                              // @ts-ignore
                                                                              if (document.selection && document.selection.empty) {
                                                                                  // @ts-ignore
                                                                                  document.selection.empty();
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 updateCode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function updateCode ($base, htmlValue, rawValue) {
                                                                              var $code = $base.find('code');
                                                                              if ($code.length === 0) {
                                                                                  return false;
                                                                              }
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 onloadRecentFavoriteTables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function onloadRecentFavoriteTables (): void {
                                                                              // Sync favorite tables from localStorage to pmadb.
                                                                              if (! $('#sync_favorite_tables').length) {
                                                                                  return;
                                                                              }
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 onloadLoginForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function onloadLoginForm () {
                                                                              /**
                                                                               * Reveal the login form to users with JS enabled
                                                                               * and focus the appropriate input field
                                                                               */
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 toggleButton has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function toggleButton ($obj) {
                                                                              // In rtl mode the toggle switch is flipped horizontally
                                                                              // so we need to take that into account
                                                                              var right;
                                                                              if ($('span.text_direction', $obj).text() === 'ltr') {
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 confirmLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function confirmLink (theLink, theSqlQuery) {
                                                                              // Confirmation is not required in the configuration file
                                                                              // or browser is Opera (crappy js implementation)
                                                                              if (window.Messages.strDoYouReally === '' || typeof (window.opera) !== 'undefined') {
                                                                                  return true;
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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 checkFormElementInRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                          function checkFormElementInRange (theForm, theFieldName, message, minimum = undefined, maximum = undefined) {
                                                                              var theField = theForm.elements[theFieldName];
                                                                              var val = parseInt(theField.value, 10);
                                                                              var min = 0;
                                                                              var max = Number.MAX_VALUE;
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.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

                                                                                  $.post({
                                                                                      url: formUrl,
                                                                                      data: formData,
                                                                                      success: response => {
                                                                                          if (! response.success) {
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 5 hrs to fix
                                                                          resources/js/src/table/structure.ts on lines 353..369

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

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

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

                                                                              if (totalBoxes === checkedBoxes) {
                                                                                  $checkall.prop({ checked: true, indeterminate: false });
                                                                              } else if (checkedBoxes > 0) {
                                                                                  $checkall.prop({ checked: true, indeterminate: true });
                                                                              } else {
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 3499..3505

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

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

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

                                                                              if (totalBoxes === checkedBoxes) {
                                                                                  $checkall.prop({ checked: true, indeterminate: false });
                                                                              } else if (checkedBoxes > 0) {
                                                                                  $checkall.prop({ checked: true, indeterminate: true });
                                                                              } else {
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 3544..3550

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

                                                                          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 teardownEnumSetEditorMessage (): void {
                                                                              $(document).off('change', 'select.column_type');
                                                                              $(document).off('change', 'select.default_type');
                                                                              $(document).off('change', 'select.virtuality');
                                                                              $(document).off('change', 'input.allow_null');
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/triggers.ts on lines 8..14

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

                                                                          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 teardownEnumSetEditor (): void {
                                                                              $(document).off('click', 'a.open_enum_editor');
                                                                              $(document).off('click', 'input.add_value');
                                                                              $(document).off('click', '#enum_editor td.drop');
                                                                              $(document).off('click', 'a.central_columns_dialog');
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 1859..1864

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

                                                                          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 teardownCreateTableEvents (): void {
                                                                              $(document).off('submit', 'form.create_table_form.ajax');
                                                                              $(document).off('click', 'form.create_table_form.ajax input[name=submit_num_fields]');
                                                                              $(document).off('keyup', 'form.create_table_form.ajax input');
                                                                              $(document).off('change', 'input[name=partition_count],input[name=subpartition_count],select[name=partition_by]');
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 2388..2393

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

                                                                          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 (window.centralColumnList[db + '_' + table][i].col_attribute !== '') {
                                                                                          fields += '(' + escapeHtml(window.centralColumnList[db + '_' + table][i].col_attribute) + ') ';
                                                                                      }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 2584..2586

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

                                                                          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 (window.centralColumnList[db + '_' + table][i].col_length !== '') {
                                                                                          fields += '(' + escapeHtml(window.centralColumnList[db + '_' + table][i].col_length) + ') ';
                                                                                      }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 2 hrs to fix
                                                                          resources/js/src/modules/functions.ts on lines 2580..2582

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

                                                                          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 (window.centralColumnList[db + '_' + table][i].col_length !== '') {
                                                                                                      fields += '(' + window.centralColumnList[db + '_' + table][i].col_length + ') ';
                                                                                                  }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2657..2659

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

                                                                                                  if (window.centralColumnList[db + '_' + table][i].col_attribute !== '') {
                                                                                                      fields += '(' + window.centralColumnList[db + '_' + table][i].col_attribute + ') ';
                                                                                                  }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2661..2663

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

                                                                                  if ($(this).hasClass('on')) {
                                                                                      if (right === 'right') {
                                                                                          operator = '-=';
                                                                                      } else {
                                                                                          operator = '+=';
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 3086..3096

                                                                          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 {
                                                                                      if (right === 'right') {
                                                                                          operator = '+=';
                                                                                      } else {
                                                                                          operator = '-=';
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 3076..3086

                                                                          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

                                                                                  $(document).on('mouseout', 'span.ajax_notification a, span.ajax_notification button, span.ajax_notification input', function () {
                                                                                      if ($(this).parents('span.ajax_notification').is(':data(tooltip)')) {
                                                                                          $(this).parents('span.ajax_notification').uiTooltip('enable');
                                                                                      }
                                                                                  });
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 1515..1519

                                                                          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

                                                                                  $(document).on('mouseover', 'span.ajax_notification a, span.ajax_notification button, span.ajax_notification input', function () {
                                                                                      if ($(this).parents('span.ajax_notification').is(':data(tooltip)')) {
                                                                                          $(this).parents('span.ajax_notification').uiTooltip('disable');
                                                                                      }
                                                                                  });
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 1521..1525

                                                                          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

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

                                                                                      var tempSetFocus = function () {
                                                                                          if ($(this).find('option:selected').val() === '') {
                                                                                              return true;
                                                                                          }
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2933..2939

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

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

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

                                                                              $outer.find('table#index_columns select').on('change', function () {
                                                                                  if ($(this).find('option:selected').val() === '') {
                                                                                      return true;
                                                                                  }
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2741..2747

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

                                                                          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

                                                                                  slide: function (event, ui) {
                                                                                      $(this).closest('.card-body').find('input[type=submit]').val(
                                                                                          window.sprintf(window.Messages.strAddToIndex, ui.value)
                                                                                      );
                                                                                  }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2527..2531

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

                                                                          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

                                                                                      slide: function (event, ui) {
                                                                                          $(this).closest('table').find('input[type=submit]').val(
                                                                                              window.sprintf(window.Messages.enum_addValue, ui.value)
                                                                                          );
                                                                                      }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2924..2928

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

                                                                          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

                                                                                      $tr.parent().find('tr:not(.noclick)')
                                                                                          .slice(start, end + 1)
                                                                                          .addClass('marked table-active')
                                                                                          .find(':checkbox')
                                                                                          .prop('checked', true)
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 937..942

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

                                                                          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

                                                                                          $tr.parent().find('tr:not(.noclick)')
                                                                                              .slice(start, end + 1)
                                                                                              .removeClass('marked table-active')
                                                                                              .find(':checkbox')
                                                                                              .prop('checked', false)
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 955..960

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

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

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

                                                                                          if ($tempDiv.find('.error code').length !== 0) {
                                                                                              $error = $tempDiv.find('.error code').addClass('error');
                                                                                          } else {
                                                                                              $error = $tempDiv;
                                                                                          }
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/table/operations.ts on lines 244..248

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

                                                                          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

                                                                              $(document).on('change', '#pma_hostname', function () {
                                                                                  $('#select_pred_hostname').val('userdefined');
                                                                                  $('#pma_hostname').prop('required', true);
                                                                              });
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2136..2139

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

                                                                          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

                                                                              $(document).on('change', '#pma_username', function () {
                                                                                  $('#select_pred_username').val('userdefined');
                                                                                  $('#pma_username').prop('required', true);
                                                                              });
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/modules/functions.ts on lines 2120..2123

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

                                                                          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

                                                                              indexDialogPreviewModal.addEventListener('hidden.bs.modal', () => {
                                                                                  indexDialogPreviewModal.querySelector('.modal-body').innerHTML = '<div class="spinner-border" role="status">' +
                                                                                      '<span class="visually-hidden">' + window.Messages.strLoading + '</span></div>';
                                                                              });
                                                                          Severity: Major
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 1 hr to fix
                                                                          resources/js/src/table/structure.ts on lines 372..375

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

                                                                          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

                                                                              $('#' + newInputId + '1').val(window.centralColumnList[db + '_' + table][offset].col_name);
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 35 mins to fix
                                                                          resources/js/src/modules/functions.ts on lines 2368..2368

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

                                                                          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

                                                                              $('#' + newInputId + '5').val(window.centralColumnList[db + '_' + table][offset].col_collation);
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 35 mins to fix
                                                                          resources/js/src/modules/functions.ts on lines 2337..2337

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

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

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

                                                                                      if (pick) {
                                                                                          fields += '<td><input class="btn btn-secondary pick w-100" type="submit" value="' +
                                                                                              window.Messages.pickColumn + '" onclick="Functions.autoPopulate(\'' + colid + '\',' + i + ')"></td>';
                                                                                      }
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 35 mins to fix
                                                                          resources/js/src/modules/functions.ts on lines 2668..2671

                                                                          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

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

                                                                                                  if (pick) {
                                                                                                      fields += '<td><input class="btn btn-secondary pick w-100" type="submit" value="' +
                                                                                                          window.Messages.pickColumn + '" onclick="Functions.autoPopulate(\'' + colid + '\',' + i + ')"></td>';
                                                                                                  }
                                                                          Severity: Minor
                                                                          Found in resources/js/src/modules/functions.ts and 1 other location - About 35 mins to fix
                                                                          resources/js/src/modules/functions.ts on lines 2591..2594

                                                                          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