Showing 3,246 of 4,217 total issues
Method _go
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _go($location, $rewrite = true, $redirect_type = 'hybrid', $text = '', $ttl = 3, $params = [])
Function _auto_update_items_orders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _auto_update_items_orders($lang)
{
if ( ! $lang) {
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 checkdnsrr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkdnsrr($hostName, $recType = '')
{
if ( ! empty($hostName)) {
if ($recType == '') {
$recType = 'MX';
- 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_latest_describe
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _get_latest_describe($sql = '')
{
if ( ! $this->sphinx_connection) {
$this->_connect();
}
- 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 init_site_id
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function init_site_id()
{
$this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
if ( ! conf('SITE_ID')) {
$site_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
Method _show_avatar
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _show_avatar($user_id = 0, $user_name = '', $as_link = 0, $is_middle = 0, $only_img_src = 0, $force_link = '')
Function _init_cur_user_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _init_cur_user_info(&$obj)
{
$this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), []];
if (MAIN_TYPE_ADMIN) {
$obj->USER_ID = $_GET['user_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
Method _index
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
Function edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function edit()
{
$ds = $this->_get_dashboard_data($_GET['id']);
if ( ! $ds['id']) {
return _e('No such record');
- 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 truncate_utf8
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function truncate_utf8($string, $len, $wordsafe = false, $dots = false)
{
if ($this->strlen($string) <= $len) {
return $string;
}
- 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_error
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function check_error($name, $dir, $check_file, $error_reason = 'git url or command is wrong') {
$libs_root = $this->libs_root;
$error_reasons = [];
if (!file_exists($check_file)) {
if (!is_writable($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_dump
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function test_dump()
{
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 _resize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _resize($f = '', $s = '')
{
global $max_x, $max_y, $method;
if (!$f || (!is_array($f) && !$s)) {
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 xml_parser_create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function xml_parser_create(&$data)
{
// Default XML encoding
$encoding = 'utf-8';
$bom = 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 _cleanup_columns_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _cleanup_columns_info($a)
{
$skip_info = ['primary', 'unique', 'type_raw', 'collate', 'row_format'];
foreach ((array) $a as $col => $info) {
foreach ((array) $info as $k => $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 test_apply
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function test_apply()
{
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
Avoid deeply nested control flow statements. Open
if (is_string($tokens[$j]) && $tokens[$j] == '[') {
++$openBracketsCount;
} elseif (is_string($tokens[$j]) && $tokens[$j] == ']') {
--$openBracketsCount;
if ($openBracketsCount == 0) {
Avoid deeply nested control flow statements. Open
if (is_string($tokens[$j]) && $tokens[$j] == '(') {
++$openBracketsCount;
} elseif (is_string($tokens[$j]) && $tokens[$j] == ')') {
--$openBracketsCount;
Function array_set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function array_set(&$array, $key, $value)
{
if ($key === null) {
return $array = $value;
}
- 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 _attr_class_clean
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _attr_class_clean($class = '')
{
if ( ! strlen($class) || strpos($class, ' ') === false) {
return $class;
}
- 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"