Function prepare2show
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function prepare2show($filescount)
{
include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
global $xoopsUser, $xoopsConfig, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
- 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 getAllPublished
has a Cognitive Complexity of 36 (exceeds 5 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)
{
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$myts =& MyTextSanitizer::getInstance();
- 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 prepare2show
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepare2show($filescount)
{
include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
global $xoopsUser, $xoopsConfig, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
Method getAllPublished
has 57 lines of code (exceeds 25 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)
{
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$myts =& MyTextSanitizer::getInstance();
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"