classes/yf_debug.class.php

Summary

Maintainability
F
1 wk
Test Coverage

File yf_debug.class.php has 1386 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Debug console.
 *
Severity: Major
Found in classes/yf_debug.class.php - About 3 days to fix

    yf_debug has 52 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_debug
    {
        public $SHOW_DB_QUERY_LOG = true;
        public $SHOW_DB_STATS = false;
        public $SHOW_DB_EXPLAIN_QUERY = true;
    Severity: Major
    Found in classes/yf_debug.class.php - About 7 hrs to fix

      Method _debug_DEBUG_YF has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _debug_DEBUG_YF(&$params = [])
          {
              if ( ! $this->SHOW_SETTINGS) {
                  return '';
              }
      Severity: Major
      Found in classes/yf_debug.class.php - About 6 hrs to fix

        Function _do_debug_db_connection_queries has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _do_debug_db_connection_queries($db, $connect_trace = [])
            {
                if ( ! $this->SHOW_DB_QUERY_LOG) {
                    return '';
                }
        Severity: Minor
        Found in classes/yf_debug.class.php - 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

        Method _do_debug_db_connection_queries has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _do_debug_db_connection_queries($db, $connect_trace = [])
            {
                if ( ! $this->SHOW_DB_QUERY_LOG) {
                    return '';
                }
        Severity: Major
        Found in classes/yf_debug.class.php - About 4 hrs to fix

          Function _show_auto_table has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _show_auto_table($items = [], $params = [], $name = '')
              {
                  if ( ! is_array($items)) {
                      $items = [];
                  }
          Severity: Minor
          Found in classes/yf_debug.class.php - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function go has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              public function go()
              {
                  if ($this->DEBUG_CONSOLE_HIDDEN) {
                      return false;
                  }
          Severity: Minor
          Found in classes/yf_debug.class.php - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function _get_git_details has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _get_git_details($FS_PATH, $as_submodule = false)
              {
                  $git_base_path = $FS_PATH . '.git';
                  if ( ! file_exists($git_base_path)) {
                      return [];
          Severity: Minor
          Found in classes/yf_debug.class.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 go has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function go()
              {
                  if ($this->DEBUG_CONSOLE_HIDDEN) {
                      return false;
                  }
          Severity: Major
          Found in classes/yf_debug.class.php - About 2 hrs to fix

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

                public function _get_git_details($FS_PATH, $as_submodule = false)
                {
                    $git_base_path = $FS_PATH . '.git';
                    if ( ! file_exists($git_base_path)) {
                        return [];
            Severity: Major
            Found in classes/yf_debug.class.php - About 2 hrs to fix

              Function _debug_DEBUG_YF has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _debug_DEBUG_YF(&$params = [])
                  {
                      if ( ! $this->SHOW_SETTINGS) {
                          return '';
                      }
              Severity: Minor
              Found in classes/yf_debug.class.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 _show_auto_table has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _show_auto_table($items = [], $params = [], $name = '')
                  {
                      if ( ! is_array($items)) {
                          $items = [];
                      }
              Severity: Major
              Found in classes/yf_debug.class.php - About 2 hrs to fix

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

                    public function _debug_stpls(&$params = [])
                    {
                        if ( ! $this->SHOW_STPLS) {
                            return '';
                        }
                Severity: Minor
                Found in classes/yf_debug.class.php - About 1 hr to fix

                  Method _debug_redis has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _debug_redis(&$params = [])
                      {
                          if ( ! $this->SHOW_REDIS_INFO) {
                              return '';
                          }
                  Severity: Minor
                  Found in classes/yf_debug.class.php - About 1 hr to fix

                    Method _debug_globals has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _debug_globals(&$params = [])
                        {
                            if ( ! $this->SHOW_GLOBALS) {
                                return '';
                            }
                    Severity: Minor
                    Found in classes/yf_debug.class.php - About 1 hr to fix

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

                          public function _debug_profiling(&$params = [])
                          {
                              $all_timings = main()->_timing;
                              if ( ! $all_timings) {
                                  return false;
                      Severity: Minor
                      Found in classes/yf_debug.class.php - About 1 hr to fix

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

                            public function _show_key_val_table($a, $params = [], $name = '')
                            {
                                if ( ! $a) {
                                    return false;
                                }
                        Severity: Minor
                        Found in classes/yf_debug.class.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 _debug_assets has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _debug_assets(&$params = [])
                            {
                                $body = [];
                        
                                $items = $this->_get_debug_data('assets_out');
                        Severity: Minor
                        Found in classes/yf_debug.class.php - About 1 hr to fix

                          Method _show_key_val_table has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _show_key_val_table($a, $params = [], $name = '')
                              {
                                  if ( ! $a) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in classes/yf_debug.class.php - About 1 hr to fix

                            Function _debug_profiling has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _debug_profiling(&$params = [])
                                {
                                    $all_timings = main()->_timing;
                                    if ( ! $all_timings) {
                                        return false;
                            Severity: Minor
                            Found in classes/yf_debug.class.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 _debug_dashboard has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _debug_dashboard()
                                {
                                    if ( ! $this->SHOW_DB_STATS) {
                                        return '';
                                    }
                            Severity: Minor
                            Found in classes/yf_debug.class.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 _get_request_headers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _get_request_headers()
                                {
                                    $arh = [];
                                    $rx_http = '/(\AHTTP_)/';
                                    foreach ((array) $_SERVER as $key => $val) {
                            Severity: Minor
                            Found in classes/yf_debug.class.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 _debug_rewrite has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _debug_rewrite(&$params = [])
                                {
                                    if ( ! $this->SHOW_REWRITE_INFO) {
                                        return '';
                                    }
                            Severity: Minor
                            Found in classes/yf_debug.class.php - About 1 hr to fix

                              Method _debug_sphinxsearch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _debug_sphinxsearch(&$params = [])
                                  {
                                      if ( ! $this->SHOW_SPHINX) {
                                          return '';
                                      }
                              Severity: Minor
                              Found in classes/yf_debug.class.php - About 1 hr to fix

                                Method _debug_memcached has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function _debug_memcached(&$params = [])
                                    {
                                        if ( ! $this->SHOW_MEMCACHED_INFO) {
                                            return '';
                                        }
                                Severity: Minor
                                Found in classes/yf_debug.class.php - About 1 hr to fix

                                  Method _debug_dashboard has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function _debug_dashboard()
                                      {
                                          if ( ! $this->SHOW_DB_STATS) {
                                              return '';
                                          }
                                  Severity: Minor
                                  Found in classes/yf_debug.class.php - About 1 hr to fix

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

                                        public function _debug_stpls(&$params = [])
                                        {
                                            if ( ! $this->SHOW_STPLS) {
                                                return '';
                                            }
                                    Severity: Minor
                                    Found in classes/yf_debug.class.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

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

                                        public function _debug_redis(&$params = [])
                                        {
                                            if ( ! $this->SHOW_REDIS_INFO) {
                                                return '';
                                            }
                                    Severity: Minor
                                    Found in classes/yf_debug.class.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

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

                                        public function _debug_memcached(&$params = [])
                                        {
                                            if ( ! $this->SHOW_MEMCACHED_INFO) {
                                                return '';
                                            }
                                    Severity: Minor
                                    Found in classes/yf_debug.class.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

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

                                        public function _debug_globals(&$params = [])
                                        {
                                            if ( ! $this->SHOW_GLOBALS) {
                                                return '';
                                            }
                                    Severity: Minor
                                    Found in classes/yf_debug.class.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

                                    Avoid too many return statements within this method.
                                    Open

                                            return $body;
                                    Severity: Major
                                    Found in classes/yf_debug.class.php - About 30 mins to fix

                                      Function _admin_link has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _admin_link($type, $text = '', $just_link = false, $replace = [])
                                          {
                                              if ( ! $this->ADD_ADMIN_LINKS || ! isset($this->ADMIN_PATHS[$type])) {
                                                  return $text;
                                              }
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Function _get_yf_version has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _get_yf_version()
                                          {
                                              $out = [];
                                              $as_submodule = false;
                                              if (strlen(YF_PATH) > strlen(APP_PATH) && substr(YF_PATH, 0, strlen(APP_PATH)) === APP_PATH) {
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Function _time_count_changes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _time_count_changes($items = [], $field = 'time')
                                          {
                                              $time_all = 0;
                                              $time_max = 0;
                                              foreach ((array) $items as $i => $v) {
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Function _debug_sphinxsearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _debug_sphinxsearch(&$params = [])
                                          {
                                              if ( ! $this->SHOW_SPHINX) {
                                                  return '';
                                              }
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Function _debug_table2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _debug_table2(&$params = [])
                                          {
                                              if ( ! $this->SHOW_TABLE2) {
                                                  return '';
                                              }
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Function _debug_events has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function _debug_events(&$params = [])
                                          {
                                              $main_ts = main()->_time_start;
                                              $items = [];
                                              foreach (['listen', 'fire', 'queue'] as $name) {
                                      Severity: Minor
                                      Found in classes/yf_debug.class.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

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                          public function _debug_cache_set(&$params = [])
                                          {
                                              if ( ! $this->SHOW_CORE_CACHE) {
                                                  return '';
                                              }
                                      Severity: Major
                                      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
                                      classes/yf_debug.class.php on lines 1076..1090
                                      classes/yf_debug.class.php on lines 1093..1109

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

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                          public function _debug_get_data(&$params = [])
                                          {
                                              if ( ! $this->SHOW_MAIN_GET_DATA) {
                                                  return '';
                                              }
                                      Severity: Major
                                      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
                                      classes/yf_debug.class.php on lines 1093..1109
                                      classes/yf_debug.class.php on lines 1112..1126

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

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                          public function _debug_cache_get(&$params = [])
                                          {
                                              if ( ! $this->SHOW_CORE_CACHE) {
                                                  return '';
                                              }
                                      Severity: Major
                                      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
                                      classes/yf_debug.class.php on lines 1076..1090
                                      classes/yf_debug.class.php on lines 1112..1126

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

                                      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