Showing 3,246 of 4,217 total issues
Method _init_sftp_phpseclib
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init_sftp_phpseclib($server_info = [])
{
if ( ! $this->DRIVER == 'phpseclib') {
return false;
}
Method test_order_by
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_order_by()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_num2str_uah_ru
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_num2str_uah_ru()
{
// $this->assertEquals( 'пятьсот пятьдесят пять триллионов четыреста сорок четыре милиарда триста тридцать три миллиона двести двадцать две тысячи сто одиннадцать гривен 99 копеек', common()->num2str( '555 444 333 222 111.999', 'uah', 'ru' ) );
// $this->assertEquals( 'п`ятьсот п`ятьдесят п`ять трильйонів чотиреста сорок чотири мільярда триста тридцять три мільйона двісті двадцять дві тисячі сто одиннадцять гривень 99 копійок', common()->num2str( '555 444 333 222 111.999', 'uah', 'ua' ) );
// $this->assertEquals( 'five hundred fifty five trillions four hundred forty four milliards three hundred thirty three millions two hundred twenty two thousands one hundred eleven grivnas 99 kopecks', common()->num2str( '555 444 333 222 111.999', 'uah', 'en' ) );
Method yf_placeholder_img
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function yf_placeholder_img($w = 100, $h = 100, $params = [])
{
$w = abs((int) $w ?: 100);
$h = abs((int) $h ?: 100);
$text = $params['text'] ?: $w . ' x ' . $h;
Function radio_box
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
{
if (is_array($name)) {
$extra = (array) $extra + $name;
$name = $extra['name'];
- 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_admin_daily_info
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _get_admin_daily_info($sql, $days = 60, $admin_ids = [])
{
if ( ! $admin_ids) {
return false;
}
- 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 _rss_general
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _rss_general()
{
foreach ((array) module('comments')->COMMENT_LINKS as $key => $value) {
$where .= 'object_name="' . $key . '"';
if ($value !== end(module('comments')->COMMENT_LINKS)) {
- 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 _process_where_cond
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _process_where_cond($left, $op, $right)
{
! $op && $op = '=';
$left = trim(strtolower($left));
if (is_string($op)) {
- 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 go
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function go($sql = '', $url_path = '', $render_type = '', $records_on_page = 0, $num_records = 0, $tpls_path = '', $add_get_vars = 1, $extra = [])
{
if (is_array($url_path)) {
$extra = $url_path;
$url_path = '';
- 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 rotate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function rotate($source_file_path, $dest_file_path, $ANGLE)
{
// Check source file
if ( ! file_exists($source_file_path) || ! filesize($source_file_path) || ! is_readable($source_file_path)) {
trigger_error('ROTATE_IMG: Source file is empty', E_USER_WARNING);
- 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_available_widgets_hooks
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _get_available_widgets_hooks()
{
if (isset($this->_avail_widgets)) {
return $this->_avail_widgets;
}
- 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 product_image_search
has a Cognitive Complexity of 19 (exceeds 5 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']);
- 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 _recursive_sort_items
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _recursive_sort_items($items = [], $skip_item_id = 0, $parent_id = 0)
{
$children = [];
$cur_group = MAIN_TYPE_USER ? $_SESSION['user_group'] : $_SESSION['admin_group'];
foreach ((array) $items as $id => $info) {
- 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_category_contents
has a Cognitive Complexity of 19 (exceeds 5 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;
- 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 copy_dir
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function copy_dir($path1, $path2, $pattern_include = '', $pattern_exclude = '', $level = null)
{
if ( ! $path1 || ! file_exists($path1)) {
return false;
}
- 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 my_array_merge
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public 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])) {
- 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 check
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function check($field_in_form = 'image_numbers', $input = null)
{
if ( ! $this->ENABLED) {
return true;
}
- 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 _helper_add_config
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function _helper_add_config($libs = [], $types = ['js', 'css'])
{
_class('assets')->clean_all();
foreach ($libs as $name => $config) {
foreach ($types as $type) {
- 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 import_base_db_structure
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function import_base_db_structure()
{
$import_tables = [
'dashboards',
'static_pages',
- 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
File yf_core_api_admin_modules.class.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class yf_core_api_admin_modules
{