Showing 3,246 of 4,217 total issues
Function _validate_prepare
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function _validate_prepare($validate_rules = [], $extra = [])
{
$form_global_validate = isset($this->_params['validate']) ? $this->_params['validate'] : (isset($this->_replace['validate']) ? $this->_replace['validate'] : []);
foreach ((array) $form_global_validate as $name => $rules) {
$this->_validate_rules[$name] = $rules;
- Read upRead up
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 send
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function send(array $params = [], &$error_message = '')
{
require_php_lib('phpmailer');
$mail = new PHPMailer(true); // defaults to using php 'mail()'
- Read upRead up
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 _split_by_comma
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function _split_by_comma(array $items)
{
// Pre-split items by comma
foreach ($items as $k => $v) {
if (is_string($v)) {
- Read upRead up
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 btn
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function btn($name, $link, $extra = [])
{
if (is_array($link)) {
$extra = $link;
$link = '';
- Read upRead up
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_oauth_providers
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function _load_oauth_providers()
{
$config = $this->_load_oauth_config();
if (isset($this->_providers_loaded)) {
return $this->_providers;
- Read upRead up
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 diff_config
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function diff_config($options = [])
{
if ( ! $options || ! is_array($options)) {
return null;
}
- Read upRead up
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 read_file
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function read_file($server_info = [], $remote_file = '', $local_file = '')
{
$local_file = trim($local_file);
$remote_file = _class('ssh')->_prepare_path($remote_file);
if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($remote_file)) {
- Read upRead up
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_paths
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function get_paths()
{
$paths = [
'called_path' => rtrim(getcwd(), '/') . '/',
'yf_path' => dirname(dirname(__DIR__)) . '/',
- Read upRead up
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_html
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function show_html($page = 'form', $vars = [], $errors = [])
{
if (php_sapi_name() == 'cli' || ! $_SERVER['PHP_SELF']) {
return print '__CONSOLE_INSTALL__' . PHP_EOL;
}
- Read upRead up
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 _payout_EcommPay
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _payout_EcommPay($title)
{
$payment_api = _class('payment_api');
$provider_class = $payment_api->provider_class([
'provider_name' => 'ecommpay',
Method repair
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function repair($sql, $db_error, $db)
{
$sql = trim($sql);
// #1191 Can't find FULLTEXT index matching the column list
if (in_array($db_error['code'], [1191]) && $this->RESTORE_FULLTEXT_INDEX) {
Method product_image_search
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function product_image_search()
{
$_GET['id'] = (int) ($_GET['id']);
if ($_GET['id']) {
$product = module('manage_shop')->_product_get_info($_GET['id']);
Method _compile_if_funcs
has 67 lines of code (exceeds 25 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'])) {
Method load_data
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load_data()
{
// Preload db installer SQL CREATE TABLE DDL statements
$ext = '.sql.php';
$pattern = '{,plugins/*/}{,share/}db/sql/*' . $ext;
Method _get_rss_feed_array
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_rss_feed_array($rss_url = '', $feed_ttl = 3600, $num_items = 15)
{
require_php_lib('yf_domit');
// Prepare cache params
Method edit
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
if (is_post() && isset($_POST['mass_delete']) && $_POST['id']) {
$_GET['action'] = 'delete';
return $this->delete();
Method _order_view
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _order_view()
{
if ($_POST['order_id']) {
$_GET['id'] = (int) ($_POST['order_id']);
} else {
Method _show_category_contents
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_category_contents($params = [])
{
$ICONS_PATH = 'uploads/icons/';
$MEDIA_PATH = WEB_PATH;
$force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
Method _skip_by_pattern
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _skip_by_pattern($path = '', $_is_dir = false, $pattern_include = '', $pattern_exclude = '')
{
if ( ! $path) {
return false;
}
Method test_load_fixtures
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_load_fixtures()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}