Showing 4,217 of 4,217 total issues

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

<?php

return [
    'fields' => [
        'id' => [
Severity: Major
Found in plugins/sys/share/db/sql_php/email_change.sql_php.php and 1 other location - About 2 days to fix
plugins/sys/share/db/sql_php/sys_smilies.sql_php.php on lines 1..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 549.

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

return [
    'fields' => [
        'id' => [
Severity: Major
Found in plugins/sys/share/db/sql_php/sys_smilies.sql_php.php and 1 other location - About 2 days to fix
plugins/sys/share/db/sql_php/email_change.sql_php.php on lines 1..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 549.

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
return [
    'name' => 'film_actor',
    'fields' => [
        'actor_id' => [
.dev/tests/unit/db/fixtures/class_db_ddl_parser_mysql_test_tbl_film_category.php on lines 1..106

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

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
return [
    'name' => 'film_category',
    'fields' => [
        'film_id' => [
.dev/tests/unit/db/fixtures/class_db_ddl_parser_mysql_test_tbl_film_actor.php on lines 1..106

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

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

            'mastercard_xplat_transfer_rub' => [
                'title' => 'MasterCard (РФ, RUB)',
                'icon' => 'mastercard',
                'request_option' => [
                    'paywayId' => '53983b55bf4efc80714160cb',
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 411..539

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

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

            'visa_xplat_transfer_rub' => [
                'title' => 'Visa (РФ, RUB)',
                'icon' => 'visa',
                'request_option' => [
                    'paywayId' => '53983b55bf4efc80714160ca',
plugins/payment/classes/yf_payment_api__provider_interkassa.class.php on lines 541..669

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

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_common has 143 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_common
{
    /** @var bool Store user-level errors */
    public $TRACK_USER_ERRORS = false;
    /** @var bool Display debug info for the empty page */
Severity: Major
Found in plugins/common/classes/yf_common.class.php - About 2 days to fix

    Function render has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render($extra = [], $replace = [])
        {
            if (isset($this->_rendered)) {
                return $this->_rendered;
            }
    Severity: Minor
    Found in plugins/form2/classes/yf_form2.class.php - About 2 days 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 _url has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _url($params = [], $host = '', $url_str = '', $for_section = null)
        {
            if (DEBUG_MODE && ! $this->FORCE_NO_DEBUG) {
                $time_start = microtime(true);
            }
    Severity: Minor
    Found in plugins/rewrite/classes/yf_rewrite.class.php - About 2 days 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

        protected function _user_message($options = null)
        {
            $url = &$this->url;
            // import operation
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_transfer.class.php and 1 other location - About 2 days to fix
    plugins/payment/admin_modules/yf_manage_payment_yandexmoney.class.php on lines 170..230

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

    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

        protected function _user_message($options = null)
        {
            $url = &$this->url;
            // import operation
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
    plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 723..783

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

    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_payment_api__provider_yandexmoney.class.php has 1026 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    _class('payment_api__provider_remote');
    
    class yf_payment_api__provider_yandexmoney extends yf_payment_api__provider_remote
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php - About 2 days to fix

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

      <?php
      
      return [
        1 => [
          'id' => '1',
      Severity: Major
      Found in .dev/install/installer_data/db_tables/sys_category_items.data.php - About 2 days to fix

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

            public function test_avail_arrays()
            {
                // TODO: deep debug why
                // For some reason it fails under current jenkins
                if (getenv('CI') === 'jenkins') {
        Severity: Major
        Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php and 1 other location - About 2 days to fix
        .dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php on lines 89..124

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

        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 test_avail_arrays()
            {
                // TODO: deep debug why
                // For some reason it fails under current jenkins
                if (getenv('CI') === 'jenkins') {
        Severity: Major
        Found in .dev/tests/unit/tpl/tpl_driver_yf_foreach_test.Test.php and 1 other location - About 2 days to fix
        .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php on lines 408..443

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

        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_remote_files.class.php has 1004 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * File uploads wrapper.
         *
        Severity: Major
        Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 days to fix

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

          <?php
          
          _class('payment_api__provider_remote');
          
          class yf_payment_api__provider_ecommpay extends yf_payment_api__provider_remote
          Severity: Major
          Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 2 days to fix

            Function _process_where has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _process_where(array $where, $func_name = 'where', $return_array = false)
                {
                    $sql = '';
                    if ($count = count((array) $where)) {
                        $all_numeric = $this->_is_where_all_numeric($where);
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 days 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

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

                    return form($replace, [
                            'filter' => true,
                            'selected' => $filter,
                        ])
                        ->daterange('datetime_start', [
            Severity: Major
            Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 1 other location - About 2 days to fix
            plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 128..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 471.

            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

                    return form($replace, [
                            'filter' => true,
                            'selected' => $filter,
                        ])
                        ->daterange('datetime_start', [
            Severity: Major
            Found in plugins/payment/admin_modules/yf_manage_deposit.class.php and 1 other location - About 2 days to fix
            plugins/payment/admin_modules/yf_manage_payout.class.php on lines 180..224

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

            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