Showing 3,246 of 4,217 total issues

yf_manage_payout has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_manage_payout
{
    public $IS_PAYOUT_INTERKASSA = null;

    public $payment_api = null;
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 5 hrs to fix

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

    <?php
    
    
    class yf_manage_shop_products
    {

      Method api_payout has 144 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_webmoney.class.php - About 5 hrs to fix

        Function ajax_city has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function ajax_city()
            {
                main()->NO_GRAPHICS = true;
                // Check input
                if (isset($_REQUEST['country'])) {
        Severity: Minor
        Found in plugins/geo/modules/yf_geo_content.class.php - About 5 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 _external_response has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _external_response()
            {
                $operation_id = $_GET['operation_id'];
                $secret = $_GET['secret'];
                $payment_api = $this->payment_api;
        Severity: Minor
        Found in plugins/payment/classes/yf_payment_api__provider_bitcoin.class.php - About 5 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 _fix_data_safe has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _fix_data_safe($table, $data = [], $extra = [])
            {
                if ( ! $this->FIX_DATA_SAFE) {
                    return $data;
                }
        Severity: Minor
        Found in plugins/db/classes/yf_db.class.php - About 5 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_as_html has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _render_as_html(&$params, &$a, &$to_hide)
            {
                $body = '';
                $header_links = [];
                if (MAIN_TYPE_ADMIN && ! $params['no_pages'] && ! $params['no_total'] && $a['total']) {
        Severity: Minor
        Found in plugins/table2/classes/yf_table2.class.php - About 5 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 delete has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function delete()
            {
                $i = preg_replace('~[^a-z0-9_]+~ims', '', trim($_GET['i']));
                if ( ! $i || ! isset($this->instances[$i])) {
                    return js_redirect('/@object');
        Severity: Minor
        Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 5 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 api_payout has 143 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_payeer.class.php - About 5 hrs to fix

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

          <?php
          
          // Content display by geo location (ads, pages, etc)
          class yf_geo_content
          {
          Severity: Minor
          Found in plugins/geo/modules/yf_geo_content.class.php - About 5 hrs to fix

            Method _add has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _add($params = [])
                {
                    if (empty(main()->USER_ID) && MAIN_TYPE_USER && ! $params['allow_guests_posts']) {
                        return '';
                    }
            Severity: Major
            Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 5 hrs to fix

              Method _multi_request has 142 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _multi_request($urls, $options = [], $max_threads = 0, &$requests_info = [])
                  {
                      if ( ! $max_threads) {
                          $max_threads = $this->CURL_DEF_MAX_THREADS;
                      }
              Severity: Major
              Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 hrs to fix

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

                <?php
                
                /**
                 * Shop module.
                 */
                Severity: Minor
                Found in plugins/shop/modules/yf_shop.class.php - About 5 hrs to fix

                  Function _security_settings has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _security_settings()
                      {
                          asset('bfh-select');
                  
                          $user_id = main()->USER_ID;
                  Severity: Minor
                  Found in plugins/sys/admin_modules/yf_manage_security.class.php - About 5 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 has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function init()
                      {
                          // Chanined config rule
                          if ($this->BLOCK_FAILED_LOGINS) {
                              $this->LOG_FAILED_LOGINS = true;
                  Severity: Minor
                  Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 5 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 has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _init()
                      {
                          $this->supported_conds = [
                              'in' => function ($a) {
                                  return ' IN( ' . _es($a['value']) . ' )';
                  Severity: Minor
                  Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 5 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_remote_page has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function get_remote_page($url = '', $cache_ttl = -1, $url_options = [], &$requests_info = [])
                      {
                          if (empty($url)) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 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 scan_dir has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
                      {
                          if (is_array($start_dir)) {
                              $_merged_contents = [];
                              foreach ((array) $start_dir as $_start_dir) {
                  Severity: Minor
                  Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 5 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

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

                  <?php
                  
                  class sample_core_api
                  {
                      public function _init()
                  Severity: Minor
                  Found in .dev/samples/classes/sample_core_api.class.php - About 5 hrs to fix

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

                    <?php
                    
                    /**
                     * Comments handler.
                     *
                    Severity: Minor
                    Found in plugins/comments/modules/yf_comments.class.php - About 5 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language