Showing 197 of 242 total issues
Avoid deeply nested control flow statements. Open
if ( ! $theme_updated && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'theme_set' ) {
$member_handler =& xoops_gethandler( 'member' );
$member_handler->updateUsersByField( 'theme', $_POST[ $config->getVar( 'conf_name' ) ] );
$theme_updated = true;
}
Method _addFile
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
Avoid deeply nested control flow statements. Open
if ( '.' == substr( $file, 0, 1 ) ) {
continue;
}
Function smarty_resource_db_tplinfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function smarty_resource_db_tplinfo( $tpl_name ) {
static $cache = [];
global $xoopsConfig;
if ( isset( $cache[ $tpl_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 _addList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _addList($p_list, &$p_result_list,
$p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
{
$v_result=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 tplsadmin_import_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function tplsadmin_import_data( $tplset, $tpl_file, $tpl_source, $lastmodified = 0 ) {
$db =& XoopsDatabaseFactory::getDatabaseConnection();
// check the file is valid template
- 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 ( ! $tpl_updated && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'template_set' ) {
// clear cached/compiled files and regenerate them if default theme has been changed
if ( $xoopsConfig['template_set'] != $_POST[ $config->getVar( 'conf_name' ) ] ) {
$newtplset = $_POST[ $config->getVar( 'conf_name' ) ];
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct() {
global $xoopsConfig;
// language 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
Avoid deeply nested control flow statements. Open
if ( ! $startmod_updated && $new_value != '--' && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'startpage' ) {
$member_handler =& xoops_gethandler( 'member' );
$groups =& $member_handler->getGroupList();
$moduleperm_handler =& xoops_gethandler( 'groupperm' );
$module_handler =& xoops_gethandler( 'module' );
Avoid deeply nested control flow statements. Open
if ( is_file( $file_path ) ) {
$mtime = (int) @filemtime( $file_path );
$tplfile = $tplfile_handler->create();
$tplfile->setVar( 'tpl_source', file_get_contents( $file_path ), true );
$tplfile->setVar( 'tpl_refid', $mid );
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($mydirname, $table_body, $primary_key, $cols, $page_name, $action_base_hiddens)
Function list_groups
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function list_groups() {
// query for getting blocks
$sql = 'SELECT * FROM ' . $this->db->prefix( 'newblocks' ) . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight";
$result = $this->db->query( $sql );
$block_arr = [];
- 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 processPost
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function processPost() {
// Ticket Check
if ( ! $GLOBALS['xoopsGTicket']->check( true, 'myblocksadmin' ) ) {
redirect_header( XOOPS_URL . '/', 3, $GLOBALS['xoopsGTicket']->getErrors() );
}
- 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 _extractFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _extractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_params)
Method _diag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
Method _block
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _block( $xbeg, $xlen, $ybeg, $ylen, $edits ) {
Function altsys_message_append_onuninstall
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function altsys_message_append_onuninstall(&$module_obj, &$log)
{
if (is_array(@$GLOBALS['ret'])) {
foreach ($GLOBALS['ret'] as $message) {
$log->add(strip_tags($message));
- 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 _renderOptionTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _renderOptionTree( &$tree, $option, $prefix, $parentIds = [] ) {
$tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
// If there are parent elements, add javascript that will
// make them selected when this element is checked to make
// sure permissions to parent items are added as well.
- 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 tplsadmin_copy_templates_f2db
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function tplsadmin_copy_templates_f2db( $tplset_to, $whr_append = '1' ) {
global $db;
// get tplsource
//$result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND ($whr_append)") ;
- 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 _tool_TranslateWinPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _tool_TranslateWinPath($p_path, $p_remove_disk_letter=true)
{
if (mb_stristr(php_uname(), 'windows')) {
// ----- Look for potential disk letter
if (($p_remove_disk_letter)
- 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"