Showing 4,217 of 4,217 total issues

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

<?php

return [
  1 => [
    'id' => '1',
Severity: Minor
Found in .dev/install/installer_data/db_tables_en/static_pages.data.php - About 7 hrs to fix

    Function _build has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _build($a, $class_rewrite)
        {
            $u = false;
            if ( ! empty($class_rewrite->BUILD_RULES)) {
                foreach ((array) $class_rewrite->BUILD_RULES as $func) {
    Severity: Minor
    Found in plugins/rewrite/classes/rewrite/yf_rewrite_pattern_yf.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 render has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render($params = [])
        {
            if (DEBUG_MODE) {
                $ts = microtime(true);
            }
    Severity: Minor
    Found in plugins/table2/classes/yf_table2.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 init_constants has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

        public function init_constants()
        {
            $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
            // Save current working directory (to restore it later when execute shutdown functions)
            $this->_CWD = getcwd();
    Severity: Minor
    Found in classes/yf_main.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

    Method show has 181 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function show()
        {
            $object = &$this->object;
            $action = &$this->action;
            $filter_name = &$this->filter_name;
    Severity: Major
    Found in plugins/payment/admin_modules/yf_manage_payment_operation.class.php - About 7 hrs to fix

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

      <?php
      
      return [
        1 => [
          'id' => '1',
      Severity: Major
      Found in .dev/install/installer_data/db_tables/static_pages.data.php and 1 other location - About 7 hrs to fix
      .dev/install/installer_data/db_tables_en/static_pages.data.php on lines 1..485

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

      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 [
        1 => [
          'id' => '1',
      .dev/install/installer_data/db_tables/static_pages.data.php on lines 1..52

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

      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 179 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_interkassa.class.php - About 7 hrs to fix

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

        <?php
        
        class yf_ck_file_browser
        {
            public $TOP_DIR = '/uploads/';
        Severity: Minor
        Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 7 hrs to fix

          Method create_data has 179 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function create_data()
              {
          try {
                  // bear 1 is named Lawly. She is extremely dangerous. Especially when hungry.
                  $bear_lawly = bear::create([
          Severity: Major
          Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 7 hrs to fix

            Method _get_iso639_list has 178 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _get_iso639_list()
                {
                    // TODO: use db('languages') instead
                    return [
                        'aa' => ['Afar'],

              Function translate_string has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function translate_string($in, $args = 0, $lang = '')
                  {
                      if ( ! $in) {
                          return $in;
                      }
              Severity: Minor
              Found in plugins/locale/classes/yf_i18n.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 46 (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/sys/classes/core_api/yf_core_api_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 connect has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function connect($db_host = '', $db_user = '', $db_pswd = null, $db_name = null, $force = false, $params = [])
                  {
                      if (is_array($db_host)) {
                          $params = $db_host;
                          $db_host = '';
              Severity: Minor
              Found in plugins/db/classes/yf_db.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 show_metatags has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function show_metatags($meta = [])
                  {
                      if (empty($meta)) {
                          $meta = $this->META_DEFAULT;
                      }
              Severity: Minor
              Found in classes/yf_graphics.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 4 locations. Consider refactoring.
              Open

                  public function test_less_than()
                  {
                      $this->assertFalse(_class('validate')->less_than('12345'));
                      $this->assertFalse(_class('validate')->less_than('12345', ['param' => '0']));
                      $this->assertTrue(_class('validate')->less_than('4', ['param' => '5']));
              Severity: Major
              Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
              .dev/tests/unit/class_validate_test.Test.php on lines 199..211
              .dev/tests/unit/class_validate_test.Test.php on lines 225..237
              .dev/tests/unit/class_validate_test.Test.php on lines 238..250

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

              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

                  public function test_greater_than_equal_to()
                  {
                      $this->assertTrue(_class('validate')->greater_than_equal_to('12345'));
                      $this->assertTrue(_class('validate')->greater_than_equal_to('12345', ['param' => '0']));
                      $this->assertFalse(_class('validate')->greater_than_equal_to('4', ['param' => '5']));
              Severity: Major
              Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
              .dev/tests/unit/class_validate_test.Test.php on lines 199..211
              .dev/tests/unit/class_validate_test.Test.php on lines 212..224
              .dev/tests/unit/class_validate_test.Test.php on lines 238..250

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

              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

                  public function test_less_than_equal_to()
                  {
                      $this->assertFalse(_class('validate')->less_than_equal_to('12345'));
                      $this->assertFalse(_class('validate')->less_than_equal_to('12345', ['param' => '0']));
                      $this->assertTrue(_class('validate')->less_than_equal_to('4', ['param' => '5']));
              Severity: Major
              Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
              .dev/tests/unit/class_validate_test.Test.php on lines 199..211
              .dev/tests/unit/class_validate_test.Test.php on lines 212..224
              .dev/tests/unit/class_validate_test.Test.php on lines 225..237

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

              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 coupon_delete()
                  {
                      $_GET['id'] = (int) ($_GET['id']);
                      if ( ! empty($_GET['id'])) {
                          $info = db()->query_fetch('SELECT * FROM ' . db('shop_coupons') . ' WHERE id=' . (int) ($_GET['id']));
              plugins/shop/admin_modules/manage_shop/yf_manage_shop_units.class.php on lines 104..120

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

              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 unit_delete()
                  {
                      $_GET['id'] = (int) ($_GET['id']);
                      if ( ! empty($_GET['id'])) {
                          $info = db()->query_fetch('SELECT * FROM ' . db('shop_product_units') . ' WHERE id=' . (int) ($_GET['id']));
              plugins/shop/admin_modules/manage_shop/yf_manage_shop_coupons.class.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 226.

              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