Showing 4,217 of 4,217 total issues

Method test_check_box has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function test_check_box()
    {
        $html = html();
        $def_class = $html->CLASS_LABEL_CHECKBOX . ' ' . $html->CLASS_LABEL_CHECKBOX_INLINE;

Severity: Minor
Found in .dev/tests/unit/class_form_test.Test.php - About 1 hr to fix

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

        public function _get_latest_warnings()
        {
            if ( ! $this->sphinx_connection) {
                $this->_connect();
            }
    Severity: Major
    Found in plugins/search/classes/yf_sphinxsearch.class.php and 1 other location - About 1 hr to fix
    plugins/search/classes/yf_sphinxsearch.class.php on lines 220..236

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

    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 index_info($table, $index_name, &$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 1138..1150

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

    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 foreign_key_info($table, $index_name, &$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 932..944

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

    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_latest_meta()
        {
            if ( ! $this->sphinx_connection) {
                $this->_connect();
            }
    Severity: Major
    Found in plugins/search/classes/yf_sphinxsearch.class.php and 1 other location - About 1 hr to fix
    plugins/search/classes/yf_sphinxsearch.class.php on lines 241..257

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

    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

    Function cancel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            cancel: function( options ) {
                var $this = this;
                $scope.block_wait     = true;
                $scope.is_submitted   = true;
                $scope.status         = false;
    Severity: Minor
    Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 hr to fix

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

          protected function _sign_liqpay()
          {
              $form = '';
              $api = _class('payment_api__provider_liqpay');
              // test signature
      Severity: Minor
      Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

            public function confirmation_ok($options = null)
            {
                // import options
                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                // operation
        Severity: Minor
        Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

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

              public function api_token_revoke($options = null)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }

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

                public function _api_response($options)
                {
                    $operation_id = isset($_GET['operation_id']) ? (int) ($_GET['operation_id']) : '';
                    $this->payment_api->dump(['name' => ucfirst($this->PROVIDER_NAME), 'operation_id' => $operation_id]);
                    // import options
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 hr to fix

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

                  public function delete($params = [])
                  {
                      if (is_string($params)) {
                          $params = [
                              'table' => $params,
              Severity: Minor
              Found in plugins/sys/classes/yf_admin_methods.class.php - About 1 hr to fix

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

                    public function _purse_by_currency($options = null)
                    {
                        if ( ! $this->ENABLE) {
                            return  null;
                        }
                Severity: Minor
                Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 1 hr to fix

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

                      public function _init()
                      {
                          require_php_lib('twig');
                  
                          // path
                  Severity: Minor
                  Found in plugins/tpl/classes/tpl/yf_tpl_driver_twig.class.php - About 1 hr to fix

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

                        public function from()
                        {
                            $sql = '';
                            $tables = func_get_args();
                            if ( ! count((array) $tables)) {
                    Severity: Minor
                    Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr to fix

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

                          public function whereid()
                          {
                              $id = func_get_args();
                              $pk = '';
                              if (count((array) $id) > 1) {
                      Severity: Minor
                      Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr to fix

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

                            public function create_trigger($name, $table, $trigger_time, $trigger_event, $trigger_body, $extra = [], &$error = false)
                            {
                                if (strpos($name, '.') !== false) {
                                    list($db_name, $name) = explode('.', trim($name));
                                }
                        Severity: Minor
                        Found in plugins/db/classes/db/yf_db_utils_pgsql.class.php - About 1 hr to fix

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

                              public function multi_set($data = [], $ttl = 0)
                              {
                                  $do_real_work = true;
                                  if ( ! $this->_driver_ok || $this->NO_CACHE) {
                                      $do_real_work = false;
                          Severity: Minor
                          Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix

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

                                public function _drag_tpl_items(&$items)
                                {
                                    $body = [];
                            
                                    $form = _class('form2');
                            Severity: Minor
                            Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 1 hr to fix

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

                                  public function category_revision_checkout()
                                  {
                                      $type = 'category';
                                      $object = 'category_editor';
                                      $action = 'edit_item';

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

                                    public function _check_words_length($text, $length = 0, $do_encode_email = false)
                                    {
                                        if (empty($length)) {
                                            $length = 60;
                                            if (SITE_MAX_WORD_LENGTH != 'SITE_MAX_WORD_LENGTH' && SITE_MAX_WORD_LENGTH != '') {
                                Severity: Minor
                                Found in classes/yf_utils.class.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language