mariuz/firebirdwebadmin

View on GitHub
inc/export.inc.php

Summary

Maintainability
D
2 days
Test Coverage

File export.inc.php has 512 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// Purpose        functions for the data export panel
// Author         Lutz Brueckner <irie@gmx.de>
// Copyright      (c) 2000-2006 by Lutz Brueckner,
//                published under the terms of the GNU General Public Licence v.2,
Severity: Major
Found in inc/export.inc.php - About 1 day to fix

    Method sql_format_options_table has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function sql_format_options_table($export)
    {
        global $dt_strings;
    
        return '
    Severity: Major
    Found in inc/export.inc.php - About 2 hrs to fix

      Method csv_format_options_table has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function csv_format_options_table($export)
      {
          global $dt_strings;
      
          return '
      Severity: Major
      Found in inc/export.inc.php - About 2 hrs to fix

        Method export_data has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function export_data($export)
        {
            global $s_fields, $warning;
        
            ini_set('ibase.dateformat', $export['general']['date']);
        Severity: Minor
        Found in inc/export.inc.php - About 1 hr to fix

          Function export_data has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function export_data($export)
          {
              global $s_fields, $warning;
          
              ini_set('ibase.dateformat', $export['general']['date']);
          Severity: Minor
          Found in inc/export.inc.php - 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

          Method get_export_form_data has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function get_export_form_data($old)
          {
              $export = array('format' => get_request_data('dt_export_format'),
          
                  'source' => array('option' => get_request_data('dt_export_source'),
          Severity: Minor
          Found in inc/export.inc.php - About 1 hr to fix

            Method get_export_defaults has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function get_export_defaults()
            {
                $date_default = ini_get('ibase.dateformat');
                $time_default = ini_get('ibase.timeformat');
            
            
            Severity: Minor
            Found in inc/export.inc.php - About 1 hr to fix

              Method export_sql_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function export_sql_data($export, $table)
              {
                  global $fb_error, $warning, $dbhandle;
              
                  $line_ending = replace_escape_sequences($export['sql']['lineend']);
              Severity: Minor
              Found in inc/export.inc.php - About 1 hr to fix

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

                function export_sql_data($export, $table)
                {
                    global $fb_error, $warning, $dbhandle;
                
                    $line_ending = replace_escape_sequences($export['sql']['lineend']);
                Severity: Minor
                Found in inc/export.inc.php - 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

                Method csv_value has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function csv_value($value, $num_field, $enclose_type, $fields_enclosed, $escape_character, $replace_null, $fields_terminator)
                Severity: Major
                Found in inc/export.inc.php - About 50 mins to fix

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

                  function export_table_query($table, $export)
                  {
                      global $warning;
                  
                      $columns = array();
                  Severity: Minor
                  Found in inc/export.inc.php - 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 export_csv_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function export_csv_data($export)
                  {
                      global $fb_error, $warning, $dbhandle;
                  
                      $fields_terminator = replace_escape_sequences($export['csv']['fterm']);
                  Severity: Minor
                  Found in inc/export.inc.php - 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

                  There are no issues that match your filters.

                  Category
                  Status