mariuz/firebirdwebadmin

View on GitHub
inc/handle_watchtable.inc.php

Summary

Maintainability
F
3 days
Test Coverage

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

<?php
// File           inc/handle_watchtable.inc.php / FirebirdWebAdmin
// Purpose        provides the watch table handling for sql.php and data.php
// Author         Lutz Brueckner <irie@gmx.de>
// Copyright      (c) 2000-2006 by Lutz Brueckner,
Severity: Minor
Found in inc/handle_watchtable.inc.php - About 7 hrs to fix

    Method display_table has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function display_table($wt)
    {
        global $dbhandle, $sql_strings, $button_strings, $s_watch_buffer, $s_cust;
    
        if ($wt['table'] == '' || !is_array($wt['columns'])) {
    Severity: Major
    Found in inc/handle_watchtable.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 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 print_rows_nosp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function print_rows_nosp($wt)
        {
            global $dbhandle;
        
            $types = get_column_types($wt['table'], $wt['columns']);
        Severity: Minor
        Found in inc/handle_watchtable.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 watchtable_column_options has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function watchtable_column_options($table, $show_cols, $sort_col, $bloblinks, $blobas)
        {
            global $sql_strings;
        
            echo "<table class=\"table table-hover table-bordered\">\n";
        Severity: Minor
        Found in inc/handle_watchtable.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 watchtable_column_options has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function watchtable_column_options($table, $show_cols, $sort_col, $bloblinks, $blobas)
        {
            global $sql_strings;
        
            echo "<table class=\"table table-hover table-bordered\">\n";
        Severity: Minor
        Found in inc/handle_watchtable.inc.php - About 1 hr to fix

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

          function display_table($wt)
          {
              global $dbhandle, $sql_strings, $button_strings, $s_watch_buffer, $s_cust;
          
              if ($wt['table'] == '' || !is_array($wt['columns'])) {
          Severity: Minor
          Found in inc/handle_watchtable.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 print_rows_nosp has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function print_rows_nosp($wt)
          {
              global $dbhandle;
          
              $types = get_column_types($wt['table'], $wt['columns']);
          Severity: Minor
          Found in inc/handle_watchtable.inc.php - About 1 hr to fix

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

            function print_rows_sp($wt)
            {
                global $dbhandle, $fb_error;
            
                $types = get_column_types($wt['table'], $wt['columns']);
            Severity: Minor
            Found in inc/handle_watchtable.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 print_rows_sp has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function print_rows_sp($wt)
            {
                global $dbhandle, $fb_error;
            
                $types = get_column_types($wt['table'], $wt['columns']);
            Severity: Minor
            Found in inc/handle_watchtable.inc.php - About 1 hr to fix

              Method watchtable_column_options has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function watchtable_column_options($table, $show_cols, $sort_col, $bloblinks, $blobas)
              Severity: Minor
              Found in inc/handle_watchtable.inc.php - About 35 mins to fix

                Method print_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function print_value($wt, $val, $type, $colname = null, $obj = null)
                Severity: Minor
                Found in inc/handle_watchtable.inc.php - About 35 mins to fix

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

                  function get_where_str($obj)
                  {
                      static $quote;
                      if (!isset($quote)) {
                          $quote = identifier_quote($GLOBALS['s_login']['dialect']);
                  Severity: Minor
                  Found in inc/handle_watchtable.inc.php - 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

                  There are no issues that match your filters.

                  Category
                  Status