mariuz/firebirdwebadmin

View on GitHub

Showing 162 of 204 total issues

File data.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// Purpose        working with data (import/export, type in, ...)
// 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: Minor
Found in data.php - About 2 hrs to fix

    Method get_opened_table has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function get_opened_table($name, $title, $url, $curl = '', $cdiv = '')
    {
        global $s_fields, $tb_strings, $ptitle_strings;
    
        $html = <<<EOT
    Severity: Major
    Found in inc/panel_elements.inc.php - About 2 hrs to fix

      Method get_systable has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function get_systable($s_systable)
      {
          global $dbhandle;
      
          // get the field names and types
      Severity: Major
      Found in inc/system_table.inc.php - About 2 hrs to fix

        Function print_value has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function print_value($wt, $val, $type, $colname = null, $obj = null)
        {
            if ($val === null) {
                $data = '<i>NULL</i>';
                $align = 'center';
        Severity: Minor
        Found in inc/handle_watchtable.inc.php - About 2 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

        Method index_definition has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function index_definition($indexname, $title)
        {
            global $indices, $acc_strings;
        
            if ($indexname != null  &&  !isset($_POST['acc_modind_doit'])) {
        Severity: Major
        Found in inc/indices.inc.php - About 2 hrs to fix

          Method get_preset_charsets has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function get_preset_charsets($server_family = null, $server_version = null)
          {
              $charsets = array('ASCII',
                                'BIG_5',
                                'CYRL',
          Severity: Major
          Found in inc/firebird.inc.php - About 2 hrs to fix

            Method get_domain_definitions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function get_domain_definitions($olddomains)
            {
                global $dbhandle, $s_charsets;
            
                $sql = 'SELECT  F.RDB$FIELD_NAME AS DNAME,'
            Severity: Major
            Found in inc/domains.inc.php - About 2 hrs to fix

              Method get_opened_view has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function get_opened_view($name, $title, $url)
              {
                  global $dbhandle, $s_fields, $tb_strings, $acc_strings, $ptitle_strings;
              
                  $source = get_view_source($name);
              Severity: Major
              Found in inc/views.inc.php - About 2 hrs to fix

                Method get_systable_html has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function get_systable_html($table, $s_systable)
                {
                    $html = "<table id=\"systable\" class=\"table table-bordered table-hover tsep\" cellpadding=\"2\">\n<thead><tr>\n";
                    foreach (array_keys($table) as $colname) {
                        if ($s_systable['order'] == $colname) {
                Severity: Major
                Found in inc/system_table.inc.php - About 2 hrs to fix

                  Method modify_index has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function modify_index($iname)
                  {
                      global $dbhandle, $indices, $fb_error, $lsql;
                  
                      // alter the active/inactive status if the change was selected
                  Severity: Major
                  Found in inc/indices.inc.php - About 2 hrs to fix

                    Method _renderField has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function _renderField($field, $idx, $value)
                        {
                            global $sql_strings, $dt_strings;
                    
                            if (is_string($value)) {
                    Severity: Minor
                    Found in inc/DataForm.php - About 2 hrs to fix

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

                      function systable_textblobs()
                      {
                          return
                              array('RDB$CHARACTER_SETS' => array('columns' => array('RDB$DESCRIPTON'),
                                                                        'indices' => array('RDB$RDB$CHARACTER_SET_NAME'),
                      Severity: Minor
                      Found in inc/system_table.inc.php - About 1 hr to fix

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

                        function get_coldef_definition($idx, $title, $rowspan, $collate = false)
                        {
                            global $s_coldefs, $tb_strings, $s_domains;
                        
                            $coldefs = isset($s_coldefs[$idx]) ? $s_coldefs[$idx] : array();
                        Severity: Minor
                        Found in inc/panel_elements.inc.php - About 1 hr 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 get_domain_definitions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function get_domain_definitions($olddomains)
                            {
                                global $dbhandle, $s_charsets;
                            
                                $sql = 'SELECT  F.RDB$FIELD_NAME AS DNAME,'
                            Severity: Minor
                            Found in inc/domains.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

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

                                protected function _renderField($field, $idx, $value)
                                {
                                    global $sql_strings, $dt_strings;
                            
                                    if (is_string($value)) {
                            Severity: Minor
                            Found in inc/DataForm.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 build_coldef has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function build_coldef($idx, $mode = 'create')
                            {
                                global $s_coldefs;
                            
                                if (!isset($s_coldefs[$idx]['name']))
                            Severity: Minor
                            Found in inc/functions.inc.php - About 1 hr to fix

                              Method get_reserved_words has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function get_reserved_words($server_family, $server_version)
                              {
                                  $reserved_words =
                                      array('ACTION', 'ACTIVE', 'ADD', 'ADMIN', 'AFTER', 'ALL', 'ALTER', 'AND', 'ANY',
                                            'AS', 'ASC', 'ASCENDING', 'AT', 'AUTO', 'AUTODLL', 'AVG', 'BASED', 'BASENAME',
                              Severity: Minor
                              Found in inc/firebird.inc.php - About 1 hr to fix

                                Method print_value has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function print_value($wt, $val, $type, $colname = null, $obj = null)
                                {
                                    if ($val === null) {
                                        $data = '<i>NULL</i>';
                                        $align = 'center';
                                Severity: Minor
                                Found in inc/handle_watchtable.inc.php - About 1 hr to fix

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

                                  function build_datatype($defs, $type = 'column', $mode = 'create')
                                  {
                                  
                                      $datatype = $defs['type'];
                                      $sql = '';
                                  Severity: Minor
                                  Found in inc/functions.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language