Showing 3,246 of 4,217 total issues
Method _init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
$shop = module('shop');
$shop->_shop_cats = _class('cats')->_get_items_names('shop_cats');
$shop->_shop_cats_all = _class('cats')->_get_items_array('shop_cats');
Method store_admin_auth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store_admin_auth($A = [])
{
// Check if looging needed
if ( ! is_array($A) || ! $this->_LOGGING) {
return false;
Method show_visits_stats
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_visits_stats()
{
if (empty(main()->USER_ID)) {
return _error_need_login();
}
Method _find_site_path_best_match
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _find_site_path_best_match($sites, $server_ip, $server_port, $server_host)
{
$sip = explode('.', $server_ip);
$sh = array_reverse(explode('.', $server_host));
$sh2 = explode('.', $server_host);
Method _force_close_bb_codes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _force_close_bb_codes($text = '')
{
$this->_preload_data();
$add_text = '';
$opened_codes = $closed_codes = [];
Method _view
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _view()
{
$a = $this->_get_info();
if ( ! $a || ! $a['active']) {
return _404('Not found');
Method _account_info
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _account_info($account_id)
{
$cached_account_info = &main()->_cached_account_info;
if (is_numeric($account_id)) {
$account_id = (int) $account_id;
Method get_all_methods
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_all_methods($section = 'all', $privacy = '')
{
$data = [];
$func = 'get_methods';
if ($privacy == 'public') {
Method _server_info
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _server_info($server_id)
{
$cached_server_info = &main()->_cached_server_info;
if (is_numeric($server_id)) {
$server_id = (int) $server_id;
Method show
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$docs = _class('docs');
$dir = $docs->docs_dir;
$dir_len = strlen($dir);
Method test_limit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_limit()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_cleanup_31
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_cleanup_31()
{
$closure = function ($in) {
return module('register')->_login_not_exists($in);
};
Method test_valid_hostname
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_valid_hostname()
{
$this->assertTrue(_class('validate')->valid_hostname('yahoo.com'));
$this->assertTrue(_class('validate')->valid_hostname('facebook.com'));
$this->assertTrue(_class('validate')->valid_hostname('google.to.cc'));
Method test_update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_update()
{
if ($this->_need_skip_test(__FUNCTION__)) {
return;
}
Method test_1
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_1()
{
$test_array = [
'172.19.177.198, 170.51.255.218' => '170.51.255.218',
'172.19.177.198, 10.21.0.218' => '',
Method write_admin_index_php
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function write_admin_index_php($rewrite_enabled = true)
{
$admin_index_file_content = '<?php
$dev_settings = dirname(dirname(__DIR__)).\'/.dev/override.php\';
if (file_exists($dev_settings)) {
Function li
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function li($data = [], $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
$items = [];
foreach ((array) $data as $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 set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function set($name, $data, $ttl = 0)
{
if ( ! $this->is_ready()) {
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 media_objects
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function media_objects($data = [], $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
if ($data) {
$data = $this->_recursive_sort_items($data);
- 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_var_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function _get_var_info($id)
{
$id = trim($id);
if ( ! strlen($id)) {
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"