Showing 4,217 of 4,217 total issues

Method _show_filter has 202 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _show_filter()
    {
        if ( ! in_array($_GET['action'], $this->_avail_filters)) {
            return false;
        }

    File tips.data.php has 501 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
      1 => [
        'id' => '1',
    Severity: Major
    Found in plugins/sys/share/db/data/tips.data.php - About 1 day to fix

      Function show has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          public function show($out_type, $params = [])
          {
              if ( ! $out_type || ! in_array($out_type, $this->supported_out_types)) {
                  throw new Exception('Assets: unsupported out content type: ' . $out_type);
                  return null;
      Severity: Minor
      Found in plugins/assets/classes/yf_assets.class.php - About 7 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 _get_methods has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _get_methods($params = [])
          {
              $ONLY_PRIVATE_METHODS = [];
              if (isset($params['private'])) {
                  $ONLY_PRIVATE_METHODS = $params['private'];
      Severity: Minor
      Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 7 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 write_string has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          public function write_string($server_info = [], $string = '', $remote_file = '')
          {
              $remote_file = _class('ssh')->_prepare_path($remote_file);
              if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! $string || ( ! strlen($remote_file) && ! is_array($string))) {
                  return false;
      Severity: Minor
      Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 7 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

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

              if (is_array($selected)) {
                  $extra = (array) $extra + $name;
                  $name = $extra['name'];
                  $values = isset($extra['values']) ? $extra['values'] : (array) $values; // Required
                  $selected = $extra['selected'];
      Severity: Major
      Found in plugins/html/classes/html/yf_html_datetime.class.php and 1 other location - About 7 hrs to fix
      plugins/html/classes/html/yf_html_datetime.class.php on lines 28..46

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

      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 (is_array($selected)) {
                  $extra = (array) $extra + $name;
                  $selected = $extra['selected'];
      
                  $values = isset($extra['values']) ? $extra['values'] : (array) $values; // Required
      Severity: Major
      Found in plugins/html/classes/html/yf_html_datetime.class.php and 1 other location - About 7 hrs to fix
      plugins/html/classes/html/yf_html_datetime.class.php on lines 156..172

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

      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

              $expected_columns = [
                  'id' => [
                      'name' => 'id', 'type' => 'int', 'length' => '10', 'unsigned' => true, 'collate' => null, 'nullable' => false,
                      'default' => null, 'auto_inc' => true, 'primary' => true, 'unique' => false, 'type_raw' => 'int(10) unsigned',
                  ],
      Severity: Major
      Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 1 other location - About 7 hrs to fix
      .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 127..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 242.

      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 $_payout_status_message = [
              'success' => 'Платеж проведен.',
              // in_progress
              'unknown' => 'Отсутствуют статус ответ',
              '-100' => 'общая ошибка при разборе команды. неверный формат команды.',
      plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 210..261

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

      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

      <?php
      
      /**
       * MongoDB API wrapper.
       */
      Severity: Major
      Found in plugins/mongodb/classes/yf_wrapper_mongodb.class.php and 1 other location - About 7 hrs to fix
      plugins/couchbase/classes/yf_wrapper_couchbase.class.php on lines 1..59

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

      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

      <?php
      
      /**
       * CouchBase API wrapper.
       */
      Severity: Major
      Found in plugins/couchbase/classes/yf_wrapper_couchbase.class.php and 1 other location - About 7 hrs to fix
      plugins/mongodb/classes/yf_wrapper_mongodb.class.php on lines 1..59

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

      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 $_payout_status = [
              '0' => 'success',
              // in_progress
              'unknown' => 'in_progress',
              '-100' => 'in_progress',
      plugins/payment/classes/yf_payment_api__provider_webmoney.class.php on lines 263..314

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

      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

              $expected = [
                  'id' => [
                      'name' => 'id', 'type' => 'int', 'length' => '10', 'unsigned' => true, 'collate' => null, 'nullable' => false,
                      'default' => null, 'auto_inc' => true, 'primary' => true, 'unique' => false, 'type_raw' => 'int(10) unsigned',
                  ],
      Severity: Major
      Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 1 other location - About 7 hrs to fix
      .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 157..170

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

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

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

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

            public function test_create_view()
            {
                if ($this->_need_skip_test(__FUNCTION__)) {
                    return;
                }
        Severity: Major
        Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 2 other locations - About 7 hrs to fix
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 631..644
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 645..658

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

        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 lock()
            {
                $_GET['id'] = (int) ($_GET['id']);
                if ( ! empty($_GET['id'])) {
                    $ds_info = db()->get('SELECT * FROM ' . db('dashboards2') . ' WHERE id=' . (int) ($_GET['id']));
        plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 120..136

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

        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 active()
            {
                $_GET['id'] = (int) ($_GET['id']);
                if ( ! empty($_GET['id'])) {
                    $ds_info = db()->get('SELECT * FROM ' . db('dashboards2') . ' WHERE id=' . (int) ($_GET['id']));
        plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 139..155

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

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

            public function test_view_info()
            {
                if ($this->_need_skip_test(__FUNCTION__)) {
                    return;
                }
        Severity: Major
        Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 2 other locations - About 7 hrs to fix
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 631..644
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 675..688

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

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

            public function test_view_exists()
            {
                if ($this->_need_skip_test(__FUNCTION__)) {
                    return;
                }
        Severity: Major
        Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php and 2 other locations - About 7 hrs to fix
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 645..658
        .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 675..688

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

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

            public function _recursive_get_menu_items($menu_id = 0, $skip_item_id = 0)
            {
                if (empty($menu_id) || empty($this->_menu_items[$menu_id])) {
                    return false;
                }
        Severity: Minor
        Found in plugins/sys/classes/yf_core_menu.class.php - About 7 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

        Severity
        Category
        Status
        Source
        Language