Showing 3,246 of 4,217 total issues

Method api_payout has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function api_payout($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }

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

    <?php
    
    _class('payment_api__provider_remote');
    
    class yf_payment_api__provider_bitpay extends yf_payment_api__provider_remote
    Severity: Minor
    Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 6 hrs to fix

      Method balance has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function error_handler has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function error_handler($error_type, $error_msg, $error_file, $error_line)
            {
                // quickly turn off notices logging
                if ($this->NO_NOTICES && ($error_type == E_NOTICE || $error_type == E_USER_NOTICE)) {
                    return true;
        Severity: Minor
        Found in plugins/sys/classes/yf_core_errors.class.php - About 6 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 having has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function having()
            {
                $sql = '';
                $where = func_get_args();
                if ( ! count((array) $where)) {
        Severity: Minor
        Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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 order_by has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function order_by()
            {
                $sql = '';
                $items = func_get_args();
                $count = count((array) $items);
        Severity: Minor
        Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function show()
            {
                $i = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['i'])); // instance
                $g = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['g'])); // group
                $t = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['t'])); // type
        Severity: Minor
        Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 6 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 _upload_item__import_action_test has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _upload_item__import_action_test($options)
            {
                $_ = $options;
                $fields = $_['fields'];
                $keys = $_['keys'];

        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_grid has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _get_grid($data = [])
            {
                $rows = [];
                foreach ((array) $data as $row_id => $row_items) {
                    $cols = '';
        Severity: Minor
        Found in plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php - About 6 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_grid has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _get_grid($data = [])
            {
                foreach ((array) $data as $row_id => $row_items) {
                    $cols = '';
                    if (isset($row_items['cols']) && is_array($row_items['cols'])) {
        Severity: Minor
        Found in plugins/dashboards/classes/yf_dashboards2.class.php - About 6 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 _do_check_data_is_valid has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _do_check_data_is_valid($rules = [], &$data)
            {
                $validate_ok = true;
                $_all = '__all__';
                if (isset($rules[$_all])) {
        Severity: Minor
        Found in classes/yf_validate.class.php - About 6 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

        class_db_real_mysql_test has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class class_db_real_mysql_test extends db_real_abstract
        {
            public static function db_name()
            {
                return self::$DB_NAME;
        Severity: Minor
        Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php - About 6 hrs to fix

          Function compile_insert has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

              public function compile_insert($table, $data, $params = [])
              {
                  if ( ! strlen($table) || ! is_array($data)) {
                      return false;
                  }
          Severity: Minor
          Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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 _operation_check has 156 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _operation_check($options = null)
              {
                  $result = [];
                  $data = [];
                  // options
          Severity: Major
          Found in plugins/payment/classes/yf_payment_api.class.php - About 6 hrs to fix

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

            <?php
            
            
            class yf_db_ddl_parser_mysql
            {
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 6 hrs to fix

              File class_rewrite_testing_shared.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              require_once __DIR__ . '/yf_unit_tests_setup.php';
              class class_rewrite_testing_shared extends yf\tests\wrapper
              {
              Severity: Minor
              Found in .dev/tests/rewrite/class_rewrite_testing_shared.php - About 6 hrs to fix

                Method test_multi_select has 155 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function test_multi_select()
                    {
                        $html = html();
                        $def_class = $html->CLASS_SELECT_BOX;
                        $def_opt_class = $html->CLASS_SELECT_OPTION_DEFAULT;
                Severity: Major
                Found in .dev/tests/unit/class_html_test.Test.php - About 6 hrs to fix

                  Method test_config has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function test_config()
                      {
                          $fake_lib1_url = _class('assets')->get_asset('jquery', 'js');
                          $fake_lib1 = [
                              'versions' => [
                  Severity: Major
                  Found in .dev/tests/unit/class_assets_test.Test.php - About 6 hrs to fix

                    Function _check_block_rights has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _check_block_rights($block_id = 0, $OBJECT = '', $ACTION = '')
                        {
                            if (empty($block_id) || empty($OBJECT)) {
                                return false;
                            }
                    Severity: Minor
                    Found in plugins/sys/classes/yf_core_blocks.class.php - About 6 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 select has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function select()
                        {
                            $sql = '';
                            $fields = func_get_args();
                            if ( ! count((array) $fields) || $fields === []) {
                    Severity: Minor
                    Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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

                    Severity
                    Category
                    Status
                    Source
                    Language