Showing 4,217 of 4,217 total issues

yf_db_utils_pgsql has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_db_utils_pgsql extends yf_db_utils_driver
{
    public function _get_supported_field_types()
    {
        // TODO
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_pgsql.class.php - About 2 hrs to fix

    yf_dynamic has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_dynamic
    {
        /** @var bool */
        public $ERROR_IMAGE_INTERNAL = false;
        /** @var bool */
    Severity: Minor
    Found in plugins/dynamic/modules/yf_dynamic.class.php - About 2 hrs to fix

      class_db_real_query_builder_mysql_test has 25 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class class_db_real_query_builder_mysql_test extends db_real_abstract
      {
          public static function _need_skip_test($name)
          {
              if (defined('HHVM_VERSION') && getenv('TRAVIS') && getenv('CONTINUOUS_INTEGRATION')) {

        Method multi_select has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
            {
                // Passing params as array
                if (is_array($name)) {
                    $extra = (array) $extra + $name;
        Severity: Major
        Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

          Method connect has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function connect($db_host = '', $db_user = '', $db_pswd = null, $db_name = null, $force = false, $params = [])
              {
                  if (is_array($db_host)) {
                      $params = $db_host;
                      $db_host = '';
          Severity: Major
          Found in plugins/db/classes/yf_db.class.php - About 2 hrs to fix

            Method _try_to_find has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _try_to_find($input_name = '', $CUR_CHECKS = [], $where_search = '')
                {
                    // Default value
                    $IS_FOUND = false;
                    $WHAT_FOUND = '';
            Severity: Major
            Found in plugins/common/classes/common/yf_user_ban.class.php - About 2 hrs to fix

              Method _order_create has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _order_create()
                  {
                      if (empty($_POST)) {
                          return false;
                      }
              Severity: Major
              Found in plugins/shop/modules/shop/yf_shop__order_create.class.php - About 2 hrs to fix

                Method go has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function go()
                    {
                        if ( ! db()->QUERY_LOG) {
                            return false;
                        }
                Severity: Major
                Found in plugins/logs/classes/logs/yf_logs_db_queries.class.php - About 2 hrs to fix

                  Method tree has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function tree()
                      {
                          return _class('html')->tree([
                              11 => [
                                  'name' => 'Tools',
                  Severity: Major
                  Found in .dev/samples/classes/sample_html.class.php - About 2 hrs to fix

                    Method menu has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function menu()
                        {
                            return _class('html')->menu([
                                11 => [
                                    'name' => 'Tools',
                    Severity: Major
                    Found in .dev/samples/classes/sample_html.class.php - About 2 hrs to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if (in_array('file', $this->LOG_DRIVER)) {
                                  $data['output_cache'] = '0';  // mean: exec full mode (not from output cache)
                                  $log_file_path = STORAGE_PATH . $this->LOG_DIR_NAME . 'log_exec_' . gmdate('Y-m-d') . '.log';
                                  $log_dir_path = dirname($log_file_path);
                                  if ( ! file_exists($log_dir_path)) {
                      Severity: Major
                      Found in classes/yf_csrf_guard.class.php and 1 other location - About 2 hrs to fix
                      plugins/logs/classes/logs/yf_logs_exec_user.class.php on lines 198..206

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

                      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

                              if (in_array('file', $this->LOG_DRIVER)) {
                                  $data['output_cache'] = '0';  // mean: exec full mode (not from output cache)
                                  $log_file_path = STORAGE_PATH . $this->LOG_DIR_NAME . 'log_exec_' . gmdate('Y-m-d') . '.log';
                                  $log_dir_path = dirname($log_file_path);
                                  if ( ! file_exists($log_dir_path)) {
                      Severity: Major
                      Found in plugins/logs/classes/logs/yf_logs_exec_user.class.php and 1 other location - About 2 hrs to fix
                      classes/yf_csrf_guard.class.php on lines 230..238

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

                      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 add_user($name, array $data, $extra = [], &$error = false)
                          {
                              list($host, $user) = explode('@', $name);
                              // TODO: allow add only password in addition to host and user
                              //        return $this->db->insert('mysql.user WHERE user='.$this->_escape_val($name));
                      Severity: Major
                      Found in plugins/db/classes/db/yf_db_utils_mysql.class.php and 1 other location - About 2 hrs to fix
                      plugins/db/classes/db/yf_db_utils_mysql.class.php on lines 496..507

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

                      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 update_user($name, array $data, $extra = [], &$error = false)
                          {
                              list($host, $user) = explode('@', $name);
                              // TODO: allow update only password
                              //        return $this->db->update('mysql.user WHERE user='.$this->_escape_val($name));
                      Severity: Major
                      Found in plugins/db/classes/db/yf_db_utils_mysql.class.php and 1 other location - About 2 hrs to fix
                      plugins/db/classes/db/yf_db_utils_mysql.class.php on lines 479..490

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

                      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

                      Method radio_box has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
                          {
                              if (is_array($name)) {
                                  $extra = (array) $extra + $name;
                                  $name = $extra['name'];
                      Severity: Major
                      Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

                        Method get_asset_from_bower has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_asset_from_bower($name, $version = 'master', $asset_data = [], $asset_type)
                            {
                                if ( ! $name || ! $asset_data || ! isset($asset_data[$asset_type])) {
                                    return false;
                                }
                        Severity: Major
                        Found in plugins/assets/classes/yf_assets.class.php - About 2 hrs to fix

                          Method _api_response has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _api_response($request)
                              {
                                  if ( ! $this->ENABLE) {
                                      return  null;
                                  }
                          Severity: Major
                          Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 2 hrs to fix

                            Method drag_items has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function drag_items()
                                {
                                    if (empty($_GET['id'])) {
                                        return _e('No id!');
                                    }
                            Severity: Major
                            Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 2 hrs to fix

                              Method view has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function view()
                                  {
                                      $id = (int) $_GET['id'];
                                      if ($id) {
                                          $a = db()->from(self::table)->whereid($id)->get();
                              Severity: Major
                              Found in plugins/db/admin_modules/yf_manage_revisions.class.php - About 2 hrs to fix

                                Method btn has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function btn($name, $link, $extra = [])
                                    {
                                        if (is_array($link)) {
                                            $extra = $link;
                                            $link = '';
                                Severity: Major
                                Found in plugins/table2/classes/yf_table2.class.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language