Showing 47 of 60 total issues
Method xtubeUpdateBlock
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xtubeUpdateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $boptions, $groups)
{
$myblock = new XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Method xtubeEditBlock
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xtubeEditBlock($bid)
{
include_once dirname(__FILE__) . '/admin_header.php';
//include_once 'admin_header.php';
xoops_cp_header();
Method check
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function check( $post = true , $area = '' , $allow_repost = true )
{
global $xoopsModule ;
$this->_errors = array() ;
Function b_latestnews_edit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function b_latestnews_edit($options)
{
global $xoopsDB;
include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php';
- 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 extract_post_recursive
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function extract_post_recursive( $key_name , $tmp_array )
{
$table = '' ;
$form = '' ;
foreach ($tmp_array 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 makeMySelBox
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeMySelBox($title, $order = "", $preset_id = 0, $none = 0, $sel_name = "", $onchange = "")
{
if ($sel_name == "") {
$sel_name = $this->id;
}
Function makeMySelBox
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function makeMySelBox($title, $order = "", $preset_id = 0, $none = 0, $sel_name = "", $onchange = "")
{
if ($sel_name == "") {
$sel_name = $this->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 myblocksadmin_update_blockinstance
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
Function myblocksadmin_update_blockinstance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
{
global $xoopsDB ;
$instance_handler =& xoops_gethandler('blockinstance');
- 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 myblocksadmin_update_block
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array())
Method draw_repost_form
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draw_repost_form( $area = '' )
{
// Notify which file is broken
if ( headers_sent() ) {
restore_error_handler() ;
Method myblocksadmin_update_blockinstance
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
{
global $xoopsDB ;
$instance_handler =& xoops_gethandler('blockinstance');
Method xtubeUpdateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function xtubeUpdateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $boptions, $groups)
Method getAllPublished
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
static function getAllPublished($limit=0, $selected_stories=true, $start=0, $checkRight=false, $topic=0, $ihome=0, $asobject=true, $order = 'published', $topic_frontpage=false)
Function latest_news_is_admin_group
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function latest_news_is_admin_group()
{
global $xoopsUser;
$module_handler =& xoops_gethandler('module');
$xoopsModule =& $module_handler->getByDirname('news');
- 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 isBlockCloned
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
Avoid deeply nested control flow statements. Open
if ($counter > 4) {
$counter = 0;
echo "</tr>";
echo "<tr>";
}
Function XoopsGTicket
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function XoopsGTicket()
{
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
for ($j=0; $j < count($old_vals); $j++) {
$def_vals[$j] = $old_vals[$j];
}
Avoid deeply nested control flow statements. Open
if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
echo "<td class='$class' align='center' valign='bottom' width='19%'>";
echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
echo "</td>";
$counter++;