Showing 4,217 of 4,217 total issues

Method change_location has 219 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function change_location()
    {
        if ( ! main()->USE_GEO_IP) {
            return false;
        }
Severity: Major
Found in plugins/geo/modules/yf_geo_content.class.php - About 1 day to fix

    Function _external_response has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _external_response($options)
        {
            $operation_id = $options['operation_id'];
            $payment_code = $options['code'] ?: '';
            $address = $options['address'] ?: '';
    Severity: Minor
    Found in plugins/payment/classes/yf_payment_api__provider_bitaps.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

    Function tasks has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

        public function tasks($allowed_check = false)
        {
            $main = main();
            if ($main->is_console() || $main->is_ajax()) {
                $main->no_graphics(true);
    Severity: Minor
    Found in plugins/sys/classes/yf_core_blocks.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

    Function login has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

        public function login($provider, $params = [])
        {
            if ( ! $provider) {
                return false;
            }
    Severity: Minor
    Found in plugins/oauth/classes/yf_oauth.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

    File sys_log_img_resizes.sql_php.php has 526 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
        'fields' => [
            'id' => [
    Severity: Major
    Found in plugins/logs/share/db/sql_php/sys_log_img_resizes.sql_php.php - About 1 day to fix

      Function add has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

          public function add($content, $asset_type = 'bundle', $content_type_hint = 'auto', $params = [])
          {
              if (DEBUG_MODE) {
                  $trace = main()->trace_string();
              }
      Severity: Minor
      Found in plugins/assets/classes/yf_assets.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 3 locations. Consider refactoring.
      Open

      <?php
      
      class sample_db_utils
      {
          /***/
      Severity: Major
      Found in .dev/samples/classes/sample_db_utils.class.php and 2 other locations - About 1 day to fix
      .dev/samples/classes/sample_db_migrator.class.php on lines 1..42
      .dev/samples/classes/sample_db_query_builder.class.php on lines 1..42

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?php
      
      class sample_db_migrator
      {
          /***/
      Severity: Major
      Found in .dev/samples/classes/sample_db_migrator.class.php and 2 other locations - About 1 day to fix
      .dev/samples/classes/sample_db_query_builder.class.php on lines 1..42
      .dev/samples/classes/sample_db_utils.class.php on lines 1..42

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?php
      
      class sample_db_query_builder
      {
          /***/
      Severity: Major
      Found in .dev/samples/classes/sample_db_query_builder.class.php and 2 other locations - About 1 day to fix
      .dev/samples/classes/sample_db_migrator.class.php on lines 1..42
      .dev/samples/classes/sample_db_utils.class.php on lines 1..42

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

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

      <?php
      
      /**
       * File manager module.
       *
      Severity: Major
      Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 1 day to fix

        yf_core_api has 59 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_core_api
        {
            public $section_paths = [
                'core' => 'classes/',
                'user' => 'modules/',
        Severity: Major
        Found in plugins/sys/classes/yf_core_api.class.php - About 1 day to fix

          yf_shop has 59 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_shop extends yf_module
          {
              /* Test CC numbers:
          
              370000000000002 American Express Test Card
          Severity: Major
          Found in plugins/shop/modules/yf_shop.class.php - About 1 day to fix

            File class_form_test.Test.php has 519 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            
            require_once __DIR__ . '/yf_unit_tests_setup.php';
            
            
            Severity: Major
            Found in .dev/tests/unit/class_form_test.Test.php - About 1 day to fix

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

              <?php
              
              class sample_graphics
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_graphics.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

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

              <?php
              
              class sample_dir
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_dir.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

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

              <?php
              
              class sample_db
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_db.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

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

              <?php
              
              class sample_validate
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_validate.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42

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

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

              <?php
              
              class sample_utils
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_utils.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

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

              <?php
              
              class sample_common
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_common.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_model.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

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

              <?php
              
              class sample_model
              {
                  /***/
              Severity: Major
              Found in .dev/samples/classes/sample_model.class.php and 6 other locations - About 1 day to fix
              .dev/samples/classes/sample_common.class.php on lines 1..42
              .dev/samples/classes/sample_db.class.php on lines 1..42
              .dev/samples/classes/sample_dir.class.php on lines 1..42
              .dev/samples/classes/sample_graphics.class.php on lines 1..42
              .dev/samples/classes/sample_utils.class.php on lines 1..42
              .dev/samples/classes/sample_validate.class.php on lines 1..42

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

              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