Showing 540 of 47,256 total issues
Function cleaning_write_folders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function cleaning_write_folders() {
$dir = array();
$dir['templates_c'] = ICMS_COMPILE_PATH . "/";
$dir['cache'] = ICMS_CACHE_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 gregorian_to_jalali
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- 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 icms_sanitizeContentCss
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function icms_sanitizeContentCss($text) {
if (preg_match_all('/(.*?)\{(.*?)\}/i', $text, $css)) {
$css = $css[0];
$perm = $not_perm = array();
foreach($css 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 admin_refcheck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function admin_refcheck($chkref = "") {
if (empty($_SERVER['HTTP_REFERER'])) {
return true;
} else {
$ref = $_SERVER['HTTP_REFERER'];
- 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 getCustomtagsByName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getCustomtagsByName() {
if (!$this->_objects) {
global $icmsConfig;
$ret = array();
- 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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function __construct($post=false) {
$this->sanitizer =& icms_core_Textsanitizer::getInstance();
if ($post) {
$this->readPost();
- 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 issue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function issue($salt = '', $timeout = 1800, $area = '') {
global $xoopsModule;
// create a token
list($usec, $sec) = explode(" ", microtime());
- 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 replace_doubtful
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function replace_doubtful($key, $val) {
$index_expression = '';
$indexes = explode('_', $key);
$base_array = array_shift($indexes);
- 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 getModulesArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getModulesArray($full = false) {
if (!is_array($this->modules_name) || !count($this->modules_name)) {
$icms_module_handler = icms::handler('icms_module');
$installed_modules = &$icms_module_handler->getObjects();
foreach ($installed_modules as $module) {
- 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 b_system_social_show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function b_system_social_show($options) {
$block = array();
$block['provider'] = array();
$i = 0;
- 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 too many return
statements within this function. Open
return results;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return results;
Avoid too many return
statements within this function. Open
return compare & 4 ? -1 : 1;
Avoid too many return
statements within this method. Open
return false;