Showing 4,217 of 4,217 total issues

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

    public function test_11()
    {
        $html = _class('form2')->tpl_row('password');
        $this->assertEquals($html, self::_tpl('{form_row(password)}'));
        $this->assertEquals($html, self::_tpl('{form_row( password )}'));
Severity: Major
Found in .dev/tests/unit/tpl/tpl_driver_yf_form_row_test.Test.php and 1 other location - About 1 day to fix
.dev/tests/unit/tpl/tpl_driver_yf_form_row_test.Test.php on lines 18..34

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

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 test_10()
    {
        $html = _class('form2')->tpl_row('password');
        $this->assertEquals($html, self::_tpl('{form_row("password")}'));
        $this->assertEquals($html, self::_tpl('{form_row( "password" )}'));
Severity: Major
Found in .dev/tests/unit/tpl/tpl_driver_yf_form_row_test.Test.php and 1 other location - About 1 day to fix
.dev/tests/unit/tpl/tpl_driver_yf_form_row_test.Test.php on lines 35..51

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

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

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

<?php

/**
 * Locale handler.
 *
Severity: Major
Found in plugins/locale/classes/yf_i18n.class.php - About 1 day to fix

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

    <?php
    
    // TODO: connect subclasses from manage_sphinx/, do refactoring from subclasses into closures
    
    class yf_manage_sphinx
    Severity: Major
    Found in plugins/search/admin_modules/yf_manage_sphinx.class.php - About 1 day to fix

      Method product_edit has 229 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function product_edit()
          {
              $id = (int) $_GET['id'];
              $_GET['id'] = $id;
              if (empty($id)) {

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

            public function test_valid_email()
            {
                $this->assertFalse(_class('validate')->valid_email(''));
                $this->assertFalse(_class('validate')->valid_email(null));
                $this->assertFalse(_class('validate')->valid_email(false));
        Severity: Major
        Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
        .dev/tests/unit/class_validate_test.Test.php on lines 609..627

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

        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 test_email()
            {
                $this->assertFalse(_class('validate')->email(''));
                $this->assertFalse(_class('validate')->email(null));
                $this->assertFalse(_class('validate')->email(false));
        Severity: Major
        Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
        .dev/tests/unit/class_validate_test.Test.php on lines 590..608

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

        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

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

        <?php
        
        /**
         * Caching layer.
         *
        Severity: Major
        Found in plugins/cache/classes/yf_cache.class.php - About 1 day to fix

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

              public function _prepare_env()
              {
                  $this->ENV_ARRAYS = strtoupper($this->ENV_ARRAYS);
                  $data = [];
                  // Include only desired arrays
          Severity: Major
          Found in plugins/logs/classes/logs/yf_logs_user_error.class.php and 1 other location - About 1 day to fix
          plugins/sys/classes/yf_core_errors.class.php on lines 451..472

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

          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 _prepare_env()
              {
                  $this->ENV_ARRAYS = strtoupper($this->ENV_ARRAYS);
                  $data = [];
                  // Include only desired arrays
          Severity: Major
          Found in plugins/sys/classes/yf_core_errors.class.php and 1 other location - About 1 day to fix
          plugins/logs/classes/logs/yf_logs_user_error.class.php on lines 75..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 265.

          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

                      $content = table($response, ['no_total' => true])
                          ->text('datetime', 'дата')
                          ->func('data', function ($value, $extra, $row) use ($_provider_name, $_providers_user__by_name) {
                              // message
                              $message = @$row['status_message'] ?: @$row['data']['message'];
          Severity: Major
          Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 1 other location - About 1 day to fix
          plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 628..645

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

          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

                      $content = table($response, ['no_total' => true])
                          ->text('datetime', 'дата')
                          ->func('data', function ($value, $extra, $row) use ($_provider_name, $_providers_user__by_name) {
                              // message
                              $message = @$row['status_message'] ?: @$row['data']['message'];
          Severity: Major
          Found in plugins/payment/admin_modules/yf_manage_deposit.class.php and 1 other location - About 1 day to fix
          plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1073..1090

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

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

              public function repair($sql, $db_error, $db)
              {
                  $sql = trim($sql);
                  // #1191 Can't find FULLTEXT index matching the column list
                  if (in_array($db_error['code'], [1191]) && $this->RESTORE_FULLTEXT_INDEX) {
          Severity: Minor
          Found in plugins/db/classes/db/yf_db_installer_mysql.class.php - About 1 day 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 5 locations. Consider refactoring.
          Open

          <?php
          
          return [
              'fields' => [
                  'lang' => [
          plugins/shop/share/db/sql_php/shop_product_related.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_region.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_unit.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_supplier_to_region.sql_php.php on lines 1..50

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

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

          <?php
          
          return [
              'fields' => [
                  'product_id' => [
          plugins/geo/share/db/sql_php/geo_lang_to_country.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_region.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_unit.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_supplier_to_region.sql_php.php on lines 1..50

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

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

          <?php
          
          return [
              'fields' => [
                  'product_id' => [
          plugins/geo/share/db/sql_php/geo_lang_to_country.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_related.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_unit.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_supplier_to_region.sql_php.php on lines 1..50

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

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

          <?php
          
          return [
              'fields' => [
                  'product_id' => [
          plugins/geo/share/db/sql_php/geo_lang_to_country.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_related.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_region.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_supplier_to_region.sql_php.php on lines 1..50

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

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

          <?php
          
          return [
              'fields' => [
                  'supplier_id' => [
          plugins/geo/share/db/sql_php/geo_lang_to_country.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_related.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_region.sql_php.php on lines 1..50
          plugins/shop/share/db/sql_php/shop_product_to_unit.sql_php.php on lines 1..50

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

          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

          yf_payment_test has 61 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_payment_test
          {
              public $api = [
                  // 'Privat24'    => true,
                  // 'LiqPay'      => true,
          Severity: Major
          Found in plugins/payment/modules/yf_payment_test.class.php - About 1 day to fix

            yf_wrapper_ethereum has 61 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class yf_wrapper_ethereum
            {
                public $host = '127.0.0.1';
                public $port = 8545;
                public $version = '2.0';
            Severity: Major
            Found in plugins/ethereum/classes/yf_wrapper_ethereum.class.php - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language