Showing 3,246 of 4,217 total issues
Method _filter_array
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _filter_array(&$data, $filter = [], $filter_params = [], $table = null)
{
if ( ! $data || ! $filter) {
return false;
}
Method read
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read($filename)
{
// split the file into lines, we'll process it line by line
$config_file = file($filename);
Method _do_debug_db_connection_queries
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _do_debug_db_connection_queries($db, $connect_trace = [])
{
if ( ! $this->SHOW_DB_QUERY_LOG) {
return '';
}
Method read
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read($filename)
{
// split the file into lines, we'll process it line by line
$config_file = file($filename);
Method _get_modules_from_files
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
{
$admin_modules_array = [];
$pattern_include = '-f ~/' . preg_quote(ADMIN_MODULES_DIR, '~') . '.*' . preg_quote(YF_CLS_EXT, '~') . '$~';
File sys_log_core_errors.sql_php.php
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
return [
'fields' => [
'id' => [
Method test_whereid
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_whereid()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
yf_payment_api__provider_webmoney
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_payment_api__provider_webmoney extends yf_payment_api__provider_remote
{
// номер перевода в системе учета отправителя; любое целое число без знака (целое число > 0; максимально 2^31 - 1), должно быть уникальным в пределах WMID, который подписывает запрос.
// Два перевода с одним и тем же tranid с одного WMID (даже с разных кошельков) осуществить невозможно.
// Уникальность значения tranid контролируется в интервале не менее одного года.
Method text
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function text($name, $desc = '', $extra = [])
{
// Shortcut: use second param as $extra
if (is_array($desc)) {
$extra = (array) $extra + $desc;
yf_ssh
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_ssh
{
// TODO: chained mode like in form and table, mass actions on one server, array of servers, named group(s) of servers:
// ssh('s23.dev')->exec('service memcached restart');
// ssh('s23*.dev')->exec('service memcached restart');
Method _show_info_items
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_info_items()
{
// Array of text fields
$text_fields = [
'name' => 'Name',
yf_graphics
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_graphics
{
/** @var bool Add pages names to the title */
public $ADD_TITLE_PAGES = true;
/** @var bool Show auto-parsed (and tried to translate) task name */
File yf_wrapper_redis.class.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Redis API wrapper.
*/
Method _try_to_find_libs
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _try_to_find_libs()
{
if ( ! $this->AUTO_FIND_PATHS) {
return false;
}
Method form_row
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function form_row($content, $extra = [], $replace = [], $form)
{
$name = $extra['name'];
$is_html_array = (false !== strpos($name, '['));
if ($is_html_array) {
Function start
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function start()
{
$main = main();
if ( ! empty($this->_started) || $main->is_console() || conf('SESSION_OFF') || $this->OFF) {
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 _show_menu
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function _show_menu($params = [])
{
$return_array = isset($params['return_array']) ? $params['return_array'] : false;
$force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
$menu_name = $params['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 _external_response
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function _external_response()
{
$ip = common()->get_ip();
if ( ! in_array($ip, ['185.71.65.92', '185.71.65.189', '149.202.17.210'])) {
$this->external_response_errors[] = 'Invalid sender IP address ' . $ip;
- 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_for_object
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function _show_for_object($params = [])
{
if ($this->USE_TREE_MODE) {
return $this->_show_for_object_tree($params);
}
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
public function go($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $ext = '')
{
$_prev_num_errors = count((array) main()->_all_core_error_msgs);
$LIMIT_X = (int) ($LIMIT_X != -1 ? $LIMIT_X : THUMB_WIDTH);
$LIMIT_Y = (int) ($LIMIT_Y != -1 ? $LIMIT_Y : THUMB_HEIGHT);
- 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"