Showing 4,217 of 4,217 total issues

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

            'mastercard_p2p_tasnotprivat_uah' => [
                'title' => 'MasterCard (UAH)',
                'icon' => 'mastercard',
                'request_option' => [
                    // 'paywayId' => '52efa871e4ae1a3008000002', // mastercard_p2p_notprivat_uah
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 172..229
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 232..289
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 292..349

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

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

            'mastercard_p2p_tasprivat_uah' => [
                'title' => 'MasterCard (Privat24, UAH)',
                'icon' => 'mastercard',
                'request_option' => [
                    // 'paywayId' => '52efa902e4ae1a780e000001', // mastercard_p2p_privat_uah
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 172..229
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 232..289
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 352..409

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

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

class_db_real_mysql_test has 46 functions (exceeds 20 allowed). Consider refactoring.
Open

class class_db_real_mysql_test extends db_real_abstract
{
    public static function db_name()
    {
        return self::$DB_NAME;
Severity: Minor
Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php - About 6 hrs to fix

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

                if ($has_children) {
                    $ul_opened = true;
                    $items[] = PHP_EOL . '<ul class="' . ($item['level'] >= $opened_levels ? 'closed' : '') . '">' . PHP_EOL;
                } elseif ($close_li) {
                    if ($ul_opened && ! $has_children && $item['level'] != $next_item['level']) {
    Severity: Major
    Found in plugins/html/classes/html/yf_html_tree.class.php and 1 other location - About 6 hrs to fix
    plugins/html/classes/html/yf_html_tree.class.php on lines 161..174

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

    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 ($has_children) {
                    $ul_opened = true;
                    $items[] = PHP_EOL . '<ul class="' . ($item['level'] >= $opened_levels ? 'closed' : '') . '">' . PHP_EOL;
                } elseif ($close_li) {
                    if ($ul_opened && ! $has_children && $item['level'] != $next_item['level']) {
    Severity: Major
    Found in plugins/html/classes/html/yf_html_tree.class.php and 1 other location - About 6 hrs to fix
    plugins/html/classes/html/yf_html_tree.class.php on lines 105..118

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

    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 error_404($msg = '')
        {
            if ((MAIN_TYPE_ADMIN && is_logged_in()) || DEBUG_MODE) {
                // Do not override status header for logged in admin, just display error inlined
                ! $msg && $msg = t('404 Not Found');
    Severity: Major
    Found in plugins/common/classes/yf_common.class.php and 1 other location - About 6 hrs to fix
    plugins/common/classes/yf_common.class.php on lines 1968..1985

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

    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 error_403($msg = '')
        {
            if ((MAIN_TYPE_ADMIN && is_logged_in()) || DEBUG_MODE) {
                // Do not override status header for logged in admin, just display error inlined
                ! $msg && $msg = t('403 Forbidden');
    Severity: Major
    Found in plugins/common/classes/yf_common.class.php and 1 other location - About 6 hrs to fix
    plugins/common/classes/yf_common.class.php on lines 1945..1962

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

    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

        public function _hook_side_column()
        {
            $items = [];
            $url = url('/@object');
            $methods = get_class_methods(cache());
    Severity: Major
    Found in .dev/samples/classes/sample_cache.class.php and 1 other location - About 6 hrs to fix
    .dev/samples/classes/sample_main.class.php on lines 12..35

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

    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

        public function _hook_side_column()
        {
            $items = [];
            $url = url('/@object');
            $methods = get_class_methods(main());
    Severity: Major
    Found in .dev/samples/classes/sample_main.class.php and 1 other location - About 6 hrs to fix
    .dev/samples/classes/sample_cache.class.php on lines 12..35

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

    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

            foreach ((array) _class('dir')->scan(PROJECT_PATH . 'plugins/', true, $pattern_include) as $k => $v) {
                $v = str_replace('//', '/', $v);
                if (substr($v, -$yf_cls_ext_len) != YF_CLS_EXT) {
                    continue;
                }
    plugins/sys/classes/core_api/yf_core_api_user_modules.class.php on lines 76..94

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

    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

            foreach ((array) _class('dir')->scan(PROJECT_PATH . 'plugins/', true, $pattern_include) as $k => $v) {
                $v = str_replace('//', '/', $v);
                if (substr($v, -$yf_cls_ext_len) != YF_CLS_EXT) {
                    continue;
                }
    plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php on lines 78..96

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

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

        public function compile_insert($table, $data, $params = [])
        {
            if ( ! strlen($table) || ! is_array($data)) {
                return false;
            }
    Severity: Minor
    Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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 _operation_check has 156 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _operation_check($options = null)
        {
            $result = [];
            $data = [];
            // options
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api.class.php - About 6 hrs to fix

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

      <?php
      
      
      class yf_db_ddl_parser_mysql
      {
      Severity: Minor
      Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 6 hrs to fix

        File class_rewrite_testing_shared.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        require_once __DIR__ . '/yf_unit_tests_setup.php';
        class class_rewrite_testing_shared extends yf\tests\wrapper
        {
        Severity: Minor
        Found in .dev/tests/rewrite/class_rewrite_testing_shared.php - About 6 hrs to fix

          Method test_multi_select has 155 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_multi_select()
              {
                  $html = html();
                  $def_class = $html->CLASS_SELECT_BOX;
                  $def_opt_class = $html->CLASS_SELECT_OPTION_DEFAULT;
          Severity: Major
          Found in .dev/tests/unit/class_html_test.Test.php - About 6 hrs to fix

            Method test_config has 154 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function test_config()
                {
                    $fake_lib1_url = _class('assets')->get_asset('jquery', 'js');
                    $fake_lib1 = [
                        'versions' => [
            Severity: Major
            Found in .dev/tests/unit/class_assets_test.Test.php - About 6 hrs to fix

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

                          foreach ((array) $file_names as $location => $file_name) {
                              $file_text = file_get_contents($file_name);
                              // Try to get methods from parent classes (if exist one)
                              $_methods = $this->_recursive_get_methods_from_extends($file_text, $module_name, $ONLY_PRIVATE_METHODS);
                              foreach ($_methods as $method_name) {
              Severity: Major
              Found in plugins/user/admin_modules/yf_user_modules.class.php and 1 other location - About 6 hrs to fix
              plugins/sys/classes/core_api/yf_core_api_user_modules.class.php on lines 198..218

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

              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

                          foreach ((array) $file_names as $location => $file_name) {
                              $file_text = file_get_contents($file_name);
                              // Try to get methods from parent classes (if exist one)
                              $_methods = $this->_recursive_get_methods_from_extends($file_text, $user_module_name, $ONLY_PRIVATE_METHODS);
                              foreach ($_methods as $method_name) {
              plugins/user/admin_modules/yf_user_modules.class.php on lines 322..342

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

              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 yes_no_box($name = '', $desc = '', $extra = [], $replace = [])
                  {
                      if (is_array($desc)) {
                          $extra = (array) $extra + $desc;
                          $desc = '';
              Severity: Major
              Found in plugins/form2/classes/yf_form2.class.php and 1 other location - About 6 hrs to fix
              plugins/form2/classes/yf_form2.class.php on lines 1878..1898

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

              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

              Severity
              Category
              Status
              Source
              Language