blocks/latestnews.php
Function block_latestnews_show
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
Open
function block_latestnews_show($options)
{
global $xoopsTpl, $xoopsUser, $xoopsConfig, $pathIcon16, $xoopsModule;
include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.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
Method block_latestnews_show
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function block_latestnews_show($options)
{
global $xoopsTpl, $xoopsUser, $xoopsConfig, $pathIcon16, $xoopsModule;
include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.php';
Method b_latestnews_edit
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
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';
File latestnews.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
// ######################################################################
// # #
// # Latest News block by Mowaffak ( www.arabxoops.com ) #
// # based on Last Articles Block by Pete Glanz (www.glanz.ru) #
Function b_latestnews_edit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
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"