Showing 3,246 of 4,217 total issues
Function write_file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function write_file($server_info = [], $local_file = '', $remote_file = '')
{
$local_file = trim($local_file);
$remote_file = _class('ssh')->_prepare_path($remote_file);
if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_file) || ! 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 _prepare_for_box
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function _prepare_for_box($cat_items = [], $with_all = true, $parent_item_id = 0, $all = false)
{
if ( ! empty($cat_items) && is_string($cat_items)) {
$cat_items = $this->_get_items_array($cat_items);
}
- 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 preview
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function preview($extra = [])
{
conf('ROBOTS_NO_INDEX', true);
no_graphics(true);
if (main()->USER_ID != 1) {
- 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 quick_menu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function quick_menu()
{
if ( ! $this->QUICK_MENU_ENABLED
|| (MAIN_TYPE_USER && ( ! isset($_SESSION['user_id']) || ! $_SESSION['user_id']))
|| (MAIN_TYPE_ADMIN && ( ! isset($_SESSION['admin_id']) || ! $_SESSION['admin_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 tail
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function tail($file, $lines = 10)
{
if ( ! $file || ! file_exists($file)) {
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_edit_widget_items
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function _show_edit_widget_items($column_items = [], $ds = [])
{
$items_configs = $ds['data']['items_configs'];
$ds_settings = $ds['data']['settings'];
- 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
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function show()
{
$docs = _class('docs');
$dir = $docs->demo_dir;
$dir_len = strlen($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 test_php_to_sql_db_installer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function test_php_to_sql_db_installer()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
- 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 test_sql_to_php_db_installer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function test_sql_to_php_db_installer()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
- 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 apache_request_headers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function apache_request_headers()
{
$arh = [];
$rx_http = '/\AHTTP_/';
foreach ($_SERVER as $key => $val) {
- 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 combine
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function combine()
{
$assets = clone _class('assets');
$assets->clean_all();
$assets->ADD_IS_DIRECT_OUT = false;
Method get_asset
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_asset($name, $asset_type, $version = '')
{
if ( ! $name) {
return null;
}
Method _api_response
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _api_response($options)
{
// import options
is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
/*
Method _form
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _form($data, $options = null)
{
if ( ! $this->ENABLE) {
return null;
}
Method check_all_interkassa
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function check_all_interkassa($options = null)
{
// command line interface
$is_cli = (php_sapi_name() == 'cli');
$is_cli && $this->_check_all_interkassa_cli();
Method _api_provider
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _api_provider($request, $options)
{
$api = _class('api');
$payment_api = _class('payment_api');
$provider_name = $_GET['name'];
Method copy_item2
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function copy_item2()
{
if ($_POST['items_to_copy']) {
$items = unserialize(urldecode($_POST['items_to_copy']));
foreach ((array) $items as $k => $v) {
Method show_items
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_items()
{
$menu_info = db()->query_fetch('SELECT * FROM ' . db('menus') . ' WHERE id=' . (int) ($_GET['id']) . ' OR name="' . db()->es($_GET['id']) . '"');
if (empty($menu_info)) {
return _e('No such menu!');
Method _cleanup_menu_items
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _cleanup_menu_items($menu_items = [])
{
$center_block_id = _class('graphics')->_get_center_block_id();
$out = [];
Method _load_tables_sql_php_from_files
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _load_tables_sql_php_from_files($params = [])
{
$existing_files_sql_php = [];
$existing_sql_php = [];
// Preload db installer PHP array of CREATE TABLE DDL statements