Showing 4,217 of 4,217 total issues

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

            'qiwi' => [
                'title' => 'Qiwi',
                'icon' => 'qiwi',
                'ps' => '20916096',
                'currency' => [
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 43..75
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 109..141
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 167..199

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

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

            'payeer' => [
                'title' => 'Payeer',
                'icon' => 'payeer',
                'ps' => '2609',
                'currency' => [
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 76..108
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 109..141
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 167..199

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

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

            'advcash' => [
                'title' => 'Advcash',
                'icon' => 'advcash',
                'ps' => '88106414',
                'currency' => [
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 43..75
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 76..108
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 167..199

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

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

            'okpay' => [
                'title' => 'OkPay',
                'icon' => 'okpay',
                'ps' => '1577275',
                'currency' => [
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 43..75
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 76..108
plugins/payment/classes/yf_payment_api__provider_payeer.class.php on lines 109..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 147.

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 li_tree has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function li_tree($data = [], $extra = [])
    {
        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        if ($data) {
            $data = $this->_parent->_recursive_sort_items($data);
Severity: Minor
Found in plugins/html/classes/html/yf_html_tree.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 tabs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function tabs($tabs = [], $extra = [])
    {
        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];

        $extra_by_id = [];
Severity: Minor
Found in plugins/html/classes/yf_html.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 _collect_vars_in_file has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _collect_vars_in_file($file, $type, $params = [])
    {
        if ( ! $file) {
            return [];
        }

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 drag_items has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function drag_items()
    {
        if (empty($_GET['id'])) {
            return _e('No id!');
        }
Severity: Minor
Found in plugins/sys/admin_modules/yf_menus_editor.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 group_by has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function group_by()
    {
        $sql = '';
        $items = func_get_args();
        if ( ! count((array) $items)) {
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.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 _render_auto has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _render_auto(&$params, &$data)
    {
        if ($params['auto'] && $data) {
            $field_names = array_keys((array) current((array) $data));
            $skip_fields = [];
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 fetch_data has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_data($params = [])
    {
        // Templates names
        $STPL_MAIN = ! empty($params['stpl_main']) ? $params['stpl_main'] : 'system/common/get_rss_page_main';
        $STPL_ITEM = ! empty($params['stpl_item']) ? $params['stpl_item'] : 'system/common/get_rss_page_item';
Severity: Minor
Found in plugins/common/classes/common/yf_rss_data.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 _save_log has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _save_log($params = [])
    {
        if ( ! $this->LOG_REDIRECTS) {
            return false;
        }
Severity: Minor
Found in plugins/logs/classes/logs/yf_logs_redirect.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 upload_dir has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
    {
        $local_dir = _class('ssh')->_prepare_path($local_dir);
        $remote_dir = _class('ssh')->_prepare_path($remote_dir);
        if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_dir) || ! strlen($remote_dir)) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.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 mkdir_m has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function mkdir_m($server_info = [], $dir_name = '', $dir_mode = 755, $create_index_htmls/*!not implemented here!*/ = 0, $start_folder = '/')
    {
        if ( ! _class('ssh')->_INIT_OK || ! $server_info) {
            return false;
        }
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.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 _do_rewrite has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _do_rewrite()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        if ($this->is_console() || MAIN_TYPE_ADMIN || ! module_conf('tpl', 'REWRITE_MODE')) {
            return false;
Severity: Minor
Found in classes/yf_main.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 _update_config has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function _update_config($name = '', $no_indexing = false, $no_write = false)
    {
        $conf_file_path = $this->CONF_PATH . 'sphinx.conf';
        if (file_exists($conf_file_path) && ! is_readable($conf_file_path)) {
            return _e('Error!. File ' . $conf_file_path . ' is not readable! Please check permissions.');
Severity: Minor
Found in plugins/search/admin_modules/yf_manage_sphinx.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 _mkdir_m has a Cognitive Complexity of 23 (exceeds 5 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 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

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

    public function view()
    {
        // check operation
        $operation = $this->_operation();
        // import options
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 3 hrs to fix

    Method deposition has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method _do_login has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _do_login()
          {
              $AUTH_LOGIN = trim($_POST[$this->LOGIN_FIELD]);
              $AUTH_PSWD = trim($_POST[$this->PSWD_FIELD]);
      
      
      Severity: Major
      Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 3 hrs to fix
        Severity
        Category
        Status
        Source
        Language