Showing 3,246 of 4,217 total issues

Method _api_response has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _api_response()
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 3 hrs to fix

    Method _get_modules_from_files has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
        {
            $user_modules_array = [];
            $pattern_include = '-f ~/' . preg_quote(USER_MODULES_DIR, '~') . '.*' . preg_quote(YF_CLS_EXT, '~') . '$~';
            $pattern_no_submodules = '~/' . preg_quote(USER_MODULES_DIR, '~') . '[^/]+' . preg_quote(YF_CLS_EXT, '~') . '$~ims';
    Severity: Major
    Found in plugins/sys/classes/core_api/yf_core_api_user_modules.class.php - About 3 hrs to fix

      Method edit has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function edit($params = [])
          {
              if (is_string($params)) {
                  $params = ['table' => $params];
              }
      Severity: Major
      Found in plugins/sys/classes/yf_admin_methods.class.php - About 3 hrs to fix

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

        <?php
        
        require_once __DIR__ . '/db_real_abstract.php';
        
        /**
        Severity: Minor
        Found in .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php - About 3 hrs to fix

          Method go has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function go($new_file_path, $k, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
              {
          
                  // We do not want to user break our operation
                  ignore_user_abort(true);
          Severity: Major
          Found in plugins/common/classes/common/yf_multi_upload_image.class.php - About 3 hrs to fix

            Function _operation has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _operation($options = null)
                {
                    // var
                    $is_valid = true;
                    $is_options = true;
            Severity: Minor
            Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 3 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 load has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function load($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // var
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 3 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 _compile_if_funcs has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _compile_if_funcs(array $m)
                {
                    $cond = trim($m['cond']);
                    $multiple_cond = 'AND';
                    if (in_array($cond, ['if_or', 'elseif_or'])) {
            Severity: Minor
            Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 3 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_modules_from_files has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
                {
                    $modules = [];
            
                    $yf_prefix_len = strlen(YF_PREFIX);
            Severity: Minor
            Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 3 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_user_info has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get_user_info()
                {
                    if (DEBUG_MODE && $_GET['oauth_clean']) {
                        $this->_storage_clean();
                    }
            Severity: Minor
            Found in plugins/oauth/classes/oauth/yf_oauth_driver1.class.php - About 3 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_rss_page has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function show_rss_page($data = [], $params = [])
                {
                    require_php_lib('yf_feedcreator');
                    $rss = new UniversalFeedCreator();
                    if ( ! isset($params['use_cached']) || ! empty($params['use_cached'])) {
            Severity: Minor
            Found in plugins/common/classes/common/yf_rss_data.class.php - About 3 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 _perm_str2num has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _perm_str2num($perm = '')
                {
                    $perm_len = strlen(trim($perm));
                    if ($perm_len > 10 && $perm_len < 9) {
                        return false;
            Severity: Minor
            Found in plugins/ssh/classes/yf_ssh.class.php - About 3 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_server_id has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function init_server_id()
                {
                    $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                    $servers = $this->get_data('servers');
                    $this->SERVER_ID = 0;
            Severity: Minor
            Found in classes/yf_main.class.php - About 3 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 wordwrap has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function wordwrap($str, $width = 75, $break = "\n", $cut = false)
                {
                    $splitedArray = [];
                    $lines = explode("\n", $str);
                    foreach ((array) $lines as $line) {
            Severity: Minor
            Found in classes/yf_utf8.class.php - About 3 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 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function show()
                {
                    $id = preg_replace('~[^a-z0-9_-]+~ims', '', $_GET['id']);
                    $method = preg_replace('~[^a-z0-9_-]+~ims', '', $_GET['page']);
                    if (strlen($id)) {
            Severity: Minor
            Found in .dev/samples/classes/sample_form.class.php - About 3 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 my_array_merge has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                function my_array_merge($a1, $a2)
                {
                    foreach ((array) $a2 as $k => $v) {
                        if (isset($a1[$k]) && is_array($a1[$k])) {
                            if (is_array($a2[$k])) {
            Severity: Minor
            Found in .dev/install/skel_basic/config/project_conf.php - About 3 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 _external_response has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _external_response($options)
                {
                    $pos_data = json_decode($options['posData'], true);
                    $operation_id = (int) ($pos_data['orderId']);
                    $ip = common()->get_ip();
            Severity: Major
            Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 3 hrs to fix

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

              <?php
              
              
              class yf_form2_boxes
              {
              Severity: Minor
              Found in plugins/form2/classes/form2/yf_form2_boxes.class.php - About 3 hrs to fix

                Method send has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function send($params = [])
                    {
                        $driver = strtolower($params['driver'] ?: $this->DRIVER);
                        if (DEBUG_MODE || $this->LOG_EMAILS) {
                            $time_start = microtime(true);
                Severity: Major
                Found in plugins/email/classes/yf_send_mail.class.php - About 3 hrs to fix

                  Method scan_dir has 89 lines of code (exceeds 25 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: Major
                  Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language