Showing 4,217 of 4,217 total issues

Method _preload_data has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _preload_data()
    {
        if ($this->_preload_complete) {
            return true;
        }
Severity: Minor
Found in plugins/content/classes/yf_bb_codes.class.php - About 1 hr to fix

    Method save has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function save($output_file = '')
        {
            if (empty($this->tmp_img)) {
                if ( ! $this->SILENT_MODE) {
                    trigger_error('No temporary image for resizing!', E_USER_WARNING);
    Severity: Minor
    Found in plugins/content/classes/yf_resize_images.class.php - About 1 hr to fix

      Method _get_grid has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _get_grid($data = [])
          {
              foreach ((array) $data as $row_id => $row_items) {
                  $cols = '';
                  if (isset($row_items['cols']) && is_array($row_items['cols'])) {
      Severity: Minor
      Found in plugins/dashboards/classes/yf_dashboards2.class.php - About 1 hr to fix

        Method show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function show()
            {
                css('
                    #faq-search { padding-top: 20px; }
                    #faq-items { padding-top: 20px; padding-bottom: 20px; }
        Severity: Minor
        Found in plugins/content/modules/yf_faq.class.php - About 1 hr to fix

          Method test_order8 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_order8()
              {
                  $jquery_url = _class('assets')->get_asset('jquery', 'js');
                  $url = $jquery_url;
                  $url1 = $url . '?v=1';
          Severity: Minor
          Found in .dev/tests/unit/class_assets_test.Test.php - About 1 hr to fix

            Method test_apply has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function test_apply()
                {
                    if ($this->_need_skip_test(__FUNCTION__)) {
                        return;
                    }

              Method _mkdir_m has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _mkdir_m($dir_name, $dir_mode = 0755, $create_index_htmls = 0, $start_folder = '')
              {
                  if ( ! $dir_name || ! strlen($dir_name)) {
                      return 0;
                  }
              Severity: Minor
              Found in .dev/useful/pack_zend.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if (@$_is_response_raw) {
                            $result = $body;
                        } else {
                            switch (true) {
                                case  @$_is_response_json || strpos($content_type, 'application/json') === 0:
                Severity: Critical
                Found in plugins/api/classes/yf_api.class.php - About 1 hr to fix

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  plugins/comments/share/db/sql_php/comments.sql_php.php on lines 186..215
                  plugins/geo/share/db/sql_php/states.sql_php.php on lines 66..95
                  plugins/logs/share/db/sql_php/sys_log_admin_auth.sql_php.php on lines 156..185
                  plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php on lines 186..215
                  plugins/sys/share/db/sql_php/user_banners_log.sql_php.php on lines 111..140

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

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  Severity: Major
                  Found in plugins/sys/share/db/sql_php/user_banners_log.sql_php.php and 5 other locations - About 1 hr to fix
                  plugins/comments/share/db/sql_php/comments.sql_php.php on lines 186..215
                  plugins/geo/share/db/sql_php/states.sql_php.php on lines 66..95
                  plugins/logs/share/db/sql_php/sys_log_admin_auth.sql_php.php on lines 156..185
                  plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php on lines 186..215
                  plugins/logs/share/db/sql_php/sys_log_csrf_errors.sql_php.php on lines 606..635

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

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  plugins/comments/share/db/sql_php/comments.sql_php.php on lines 186..215
                  plugins/geo/share/db/sql_php/states.sql_php.php on lines 66..95
                  plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php on lines 186..215
                  plugins/logs/share/db/sql_php/sys_log_csrf_errors.sql_php.php on lines 606..635
                  plugins/sys/share/db/sql_php/user_banners_log.sql_php.php on lines 111..140

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

                  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

                      public function test_escape_table_name()
                      {
                          if ($this->_need_skip_test(__FUNCTION__)) {
                              return;
                          }
                  .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 788..796

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

                  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

                      public function _sample_navbar()
                      {
                          return implode(PHP_EOL, [
                              form_item()->country_box(['selected' => 'US', 'renderer' => 'div_box']),
                              form_item()->language_box(['selected' => 'ru', 'renderer' => 'div_box']),
                  Severity: Major
                  Found in plugins/docs/modules/yf_docs.class.php and 1 other location - About 1 hr to fix
                  .dev/demo/form/form_item.php on lines 3..10

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

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  Severity: Major
                  Found in plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php and 5 other locations - About 1 hr to fix
                  plugins/comments/share/db/sql_php/comments.sql_php.php on lines 186..215
                  plugins/geo/share/db/sql_php/states.sql_php.php on lines 66..95
                  plugins/logs/share/db/sql_php/sys_log_admin_auth.sql_php.php on lines 156..185
                  plugins/logs/share/db/sql_php/sys_log_csrf_errors.sql_php.php on lines 606..635
                  plugins/sys/share/db/sql_php/user_banners_log.sql_php.php on lines 111..140

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

                  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

                      public function test_escape_table_name()
                      {
                          if ($this->_need_skip_test(__FUNCTION__)) {
                              return;
                          }
                  Severity: Major
                  Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 1 other location - About 1 hr to fix
                  .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 1316..1324

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

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  Severity: Major
                  Found in plugins/comments/share/db/sql_php/comments.sql_php.php and 5 other locations - About 1 hr to fix
                  plugins/geo/share/db/sql_php/states.sql_php.php on lines 66..95
                  plugins/logs/share/db/sql_php/sys_log_admin_auth.sql_php.php on lines 156..185
                  plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php on lines 186..215
                  plugins/logs/share/db/sql_php/sys_log_csrf_errors.sql_php.php on lines 606..635
                  plugins/sys/share/db/sql_php/user_banners_log.sql_php.php on lines 111..140

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

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

                      'indexes' => [
                          'PRIMARY' => [
                              'name' => 'PRIMARY',
                              'type' => 'primary',
                              'columns' => [
                  Severity: Major
                  Found in plugins/geo/share/db/sql_php/states.sql_php.php and 5 other locations - About 1 hr to fix
                  plugins/comments/share/db/sql_php/comments.sql_php.php on lines 186..215
                  plugins/logs/share/db/sql_php/sys_log_admin_auth.sql_php.php on lines 156..185
                  plugins/logs/share/db/sql_php/sys_log_auth.sql_php.php on lines 186..215
                  plugins/logs/share/db/sql_php/sys_log_csrf_errors.sql_php.php on lines 606..635
                  plugins/sys/share/db/sql_php/user_banners_log.sql_php.php on lines 111..140

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

                  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

                  return function () {
                      return implode(PHP_EOL, [
                          form_item()->country_box(['selected' => 'US', 'renderer' => 'div_box']),
                          form_item()->language_box(['selected' => 'ru', 'renderer' => 'div_box']),
                          form_item()->currency_box(['selected' => 'UAH', 'renderer' => 'div_box']),
                  Severity: Major
                  Found in .dev/demo/form/form_item.php and 1 other location - About 1 hr to fix
                  plugins/docs/modules/yf_docs.class.php on lines 362..370

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

                  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

                      public function truncate_table($table, $extra = [], &$error = false)
                      {
                          if (is_array($table)) {
                              $extra = (array) $extra + $table;
                              $table = '';
                  Severity: Major
                  Found in plugins/db/classes/db/yf_db_utils_driver.class.php and 1 other location - About 1 hr to fix
                  plugins/db/classes/db/yf_db_utils_driver.class.php on lines 636..648

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

                  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

                      public function drop_table($table, $extra = [], &$error = false)
                      {
                          if (is_array($table)) {
                              $extra = (array) $extra + $table;
                              $table = '';
                  Severity: Major
                  Found in plugins/db/classes/db/yf_db_utils_driver.class.php and 1 other location - About 1 hr to fix
                  plugins/db/classes/db/yf_db_utils_driver.class.php on lines 702..714

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language