Showing 4,217 of 4,217 total issues

Method ajax has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function ajax($force_id = false)
    {
        $id = (int) ($force_id ?: $_GET['id']);
        $admin = from(self::table)->whereid($id)->get();
        if ( ! $id || ! $admin) {
Severity: Major
Found in plugins/admin/admin_modules/yf_admin.class.php - About 3 hrs to fix

    Method render has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render($params = [])
        {
            if (DEBUG_MODE) {
                $ts = microtime(true);
            }
    Severity: Major
    Found in plugins/table2/classes/yf_table2.class.php - About 3 hrs to fix

      Method _upload_item__import_action_test has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _upload_item__import_action_test($options)
          {
              $_ = $options;
              $fields = $_['fields'];
              $keys = $_['keys'];

        Method query has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function query($sql, $need_meta = false)
            {
                if (empty($sql)) {
                    return false;
                }
        Severity: Major
        Found in plugins/search/classes/yf_sphinxsearch.class.php - About 3 hrs to fix

          yf_menus_editor has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_menus_editor
          {
              /** @var string Path to icons */
              public $ICONS_PATH = 'uploads/icons/';
          
          
          Severity: Minor
          Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 3 hrs to fix

            yf_tpl_driver_yf has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class yf_tpl_driver_yf
            {
                /** @var array @conf_skip For "_process_ifs" */
                public $_cond_operators = [
                    'eq' => '==',
            Severity: Minor
            Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 3 hrs to fix

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

                  public function _get_misc_docs($dir = '')
                  {
                      $dir = $dir ?: _class('docs')->docs_dir;
                      $dir_len = strlen($dir);
                      $ext = '.stpl';
              Severity: Major
              Found in .dev/samples/classes/sample_misc.class.php and 1 other location - About 3 hrs to fix
              .dev/samples/classes/sample_demo.class.php on lines 111..126

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

              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 ( ! common()->_error_exists() && MAIN_TYPE_USER) {
                              $info_for_check = [
                                  'comment_text' => $_POST['text'],
                                  'user_id' => main()->USER_ID,
                              ];
              plugins/comments/modules/comments/yf_comments_manage.class.php on lines 62..77

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

              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 ( ! common()->_error_exists() && MAIN_TYPE_USER) {
                              $info_for_check = [
                                  'comment_text' => $_POST['text'],
                                  'user_id' => main()->USER_ID,
                              ];
              plugins/comments/modules/comments/yf_comments_manage.class.php on lines 223..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 152.

              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

                      $this->assertEquals(str_replace(
                          PHP_EOL,
                          '',
                          '<table class="' . _class('table2')->CLASS_TABLE_MAIN . '">' .
                          '<thead><th>Id</th><th>Actions</th></thead><tbody>' .
              Severity: Major
              Found in .dev/tests/unit/class_table_test.Test.php and 1 other location - About 3 hrs to fix
              .dev/tests/unit/class_table_test.Test.php on lines 120..128

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

              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

                      if ($this->SESSION_LOCK_TO_IP && ! empty($_SESSION[$this->VAR_ADMIN_ID]) && $_GET['task'] !== 'logout') {
                          // User has changed IP, logout immediately
                          $ip = common()->get_ip();
                          if ( ! isset($_SESSION[$this->VAR_LOCK_IP]) || $_SESSION[$this->VAR_LOCK_IP] !== $ip) {
                              trigger_error('AUTH: Attempt to use session with changed IP blocked, auth_ip:' . $_SESSION[$this->VAR_LOCK_IP] . ', new_ip:' . $ip . ', admin_id: ' . (int) ($_SESSION[$this->VAR_ADMIN_ID]), E_USER_WARNING);
              Severity: Major
              Found in plugins/auth/classes/auth/yf_auth_admin.class.php and 1 other location - About 3 hrs to fix
              plugins/auth/classes/auth/yf_auth_user.class.php on lines 177..185

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

              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

                      if ($this->SESSION_LOCK_TO_IP && ! empty($_SESSION[$this->VAR_USER_ID]) && $_GET['task'] !== 'logout') {
                          // User has changed IP, logout immediately
                          $ip = common()->get_ip();
                          if ( ! isset($_SESSION[$this->VAR_LOCK_IP]) || $_SESSION[$this->VAR_LOCK_IP] !== $ip) {
                              trigger_error('AUTH: Attempt to use session with changed IP blocked, auth_ip:' . $_SESSION[$this->VAR_LOCK_IP] . ', new_ip:' . $ip . ', user_id: ' . (int) ($_SESSION[$this->VAR_USER_ID]), E_USER_WARNING);
              Severity: Major
              Found in plugins/auth/classes/auth/yf_auth_user.class.php and 1 other location - About 3 hrs to fix
              plugins/auth/classes/auth/yf_auth_admin.class.php on lines 94..104

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

              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

                      $this->assertEquals(str_replace(
                          PHP_EOL,
                          '',
                          '<table class="' . _class('table2')->CLASS_TABLE_MAIN . '">' .
                          '<thead><th>Id</th><th>Actions</th></thead><tbody>' .
              Severity: Major
              Found in .dev/tests/unit/class_table_test.Test.php and 1 other location - About 3 hrs to fix
              .dev/tests/unit/class_table_test.Test.php on lines 133..141

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

              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 _get_demos($dir = '')
                  {
                      $dir = $dir ?: _class('docs')->demo_dir;
                      $dir_len = strlen($dir);
                      $ext = '.php';
              Severity: Major
              Found in .dev/samples/classes/sample_demo.class.php and 1 other location - About 3 hrs to fix
              .dev/samples/classes/sample_misc.class.php on lines 72..87

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

              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 multi_check_box has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method transfer has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function transfer($options = null)
                    {
                        $_ = &$options;
                        $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
                        // check: from, to
                Severity: Major
                Found in plugins/payment/classes/yf_payment_api.class.php - About 3 hrs to fix

                  Method _security_settings has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _security_settings()
                      {
                          asset('bfh-select');
                  
                          $user_id = main()->USER_ID;
                  Severity: Major
                  Found in plugins/sys/admin_modules/yf_manage_security.class.php - About 3 hrs to fix

                    Method http_request has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function http_request($url, $headers = [], $method = 'GET', $data = null, $retry = 3)
                        {
                            $result = new stdClass();
                            // Parse the URL, and make sure we can handle the schema.
                            $uri = parse_url($url);
                    Severity: Major
                    Found in plugins/common/classes/common/yf_remote_files.class.php - About 3 hrs to fix

                      Method show_html has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function show_html($page = 'form', $vars = [], $errors = [])
                          {
                              if (php_sapi_name() == 'cli' || ! $_SERVER['PHP_SELF']) {
                                  return print '__CONSOLE_INSTALL__' . PHP_EOL;
                              }
                      Severity: Major
                      Found in .dev/install/install.php - About 3 hrs to fix

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

                        <?php
                        
                        /**
                         * Special methods for admin authentification.
                         *
                        Severity: Minor
                        Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language