Showing 3,246 of 4,217 total issues

Function required_any has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function required_any($in, $params = [], $fields = [])
    {
        $param = trim(is_array($params) ? $params['param'] : $params);
        $wildcard = false;
        // Example: duration_day,duration_week,duration_month
Severity: Minor
Found in classes/yf_validate.class.php - About 1 hr 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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        init_yf();
        if ( ! defined('PROJECT_PATH') || ! strlen(constant('PROJECT_PATH'))) {
            $output->writeln('Error: not inside a project');
Severity: Minor
Found in .dev/console/commands/yf_console_langs_export.class.php - About 1 hr 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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        init_yf();

        $params = [];
Severity: Minor
Found in .dev/console/commands/yf_console_core_api.class.php - About 1 hr 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 process_git has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function process_git() {
        $libs_root = $this->libs_root;
        $git_urls = $this->git_urls;
        foreach ((array)$git_urls as $git_url => $lib_dir) {
            $dir = $libs_root. $lib_dir;
Severity: Minor
Found in services/_yf_autoloader.php - About 1 hr 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 operation has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        operation: function( options ) {
            var $this             = this;
            $scope.block_wait     = true;
            $scope.is_submitted   = true;
            $scope.status         = false;
Severity: Minor
Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 hr to fix

    Method _filter_form_show has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _filter_form_show($filter, $replace)
        {
            // order
            $order_fields = [
                'o.operation_id' => 'номер операций',
    Severity: Minor
    Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 1 hr to fix

      Method _init has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _init()
          {
              $payment_api = &$this->payment_api;
              $manage_lib = &$this->manage_payment_lib;
              $provider_name = &$this->provider_name;

        Method _save_csv has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _save_csv($file_name, $data = null)
            {
                // setlocale( LC_ALL, 'ru_RU.utf8' )
                // || setlocale( LC_ALL, 'ru_UA.utf8' )
                // || setlocale( LC_ALL, 'en_US.utf8' );
        Severity: Minor
        Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

          Method _get_daily_data has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _get_daily_data($days = null)
              {
                  $time = time();
                  $days = $days ?: 60;
                  $min_time = $time - $days * 86400;
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 1 hr to fix

            Method _get_daily_data has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _get_daily_data($days = null)
                {
                    $time = time();
                    $days = $days ?: 60;
                    $min_time = $time - $days * 86400;
            Severity: Minor
            Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

              Method confirmation has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function confirmation(&$options = null, &$data = null, &$operation_data = null)
                  {
                      $status = true;
                      $result = [
                          'status' => &$status,
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                Method clone_menu has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function clone_menu()
                    {
                        $_GET['id'] = (int) ($_GET['id']);
                        if (empty($_GET['id'])) {
                            return _e('No id!');
                Severity: Minor
                Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 1 hr to fix

                  Method _html_control has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _html_control($name, $values, $extra = [], $replace = [], $func_html_control = '')
                      {
                          if ( ! is_array($extra)) {
                              $extra = [];
                          }
                  Severity: Minor
                  Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

                    Method tbl_link has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function tbl_link($name, $link, $extra = [], $replace = [], $form)
                        {
                            if (is_array($name)) {
                                $extra = (array) $extra + $name;
                                $name = $extra['name'];
                    Severity: Minor
                    Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php - About 1 hr to fix

                      Method input has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function input($name, $desc = '', $extra = [], $replace = [])
                          {
                              if (is_array($desc)) {
                                  $extra = (array) $extra + $desc;
                                  $desc = '';
                      Severity: Minor
                      Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

                        Method _get_extra_override has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _get_extra_override($form_id = '')
                            {
                                if ( ! strlen($form_id)) {
                                    return [];
                                }
                        Severity: Minor
                        Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

                          Method _get_email_text has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _get_email_text($replace = [], $extra = [])
                              {
                                  if ($extra['tpl_name']) {
                                      $lang = $extra['locale'] ?: conf('language');
                                      $a = db()->from(self::table_tpls)->where('name', $extra['tpl_name'])->where('locale', $lang)->get();
                          Severity: Minor
                          Found in plugins/email/classes/yf_email.class.php - About 1 hr to fix

                            Method dump has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function dump($params = [])
                                {
                                    $utils = $this->db->utils();
                                    $installer = $this->db->installer();
                                    $db_prefix = $this->db->DB_PREFIX;
                            Severity: Minor
                            Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 hr to fix

                              Method update_batch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function update_batch($table, array $data, $index = null, $only_sql = false, $params = [])
                                  {
                                      if ( ! $index) {
                                          $index = $this->get_key_name($table);
                                      }
                              Severity: Minor
                              Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr to fix

                                Method refresh_modules_list has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function refresh_modules_list($silent = false)
                                    {
                                        // Cleanup duplicate records
                                        $q = db()->query('SELECT name, COUNT(*) AS num FROM ' . db('admin_modules') . ' GROUP BY name HAVING num > 1');
                                        while ($a = db()->fetch_assoc($q)) {
                                Severity: Minor
                                Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language