Showing 310 of 310 total issues
Method news_tag_iteminfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_tag_iteminfo(&$items)
{
if (empty($items) || !\is_array($items)) {
return false;
}
Method xoops_module_install_news
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_news(\XoopsModule $module)
{
$module_id = $module->getVar('mid');
/** @var \XoopsGroupPermHandler $grouppermHandler */
$grouppermHandler = xoops_getHandler('groupperm');
Method getAllStoriesCount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAllStoriesCount($storytype = 1, $checkRight = false)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$sql = 'SELECT count(*) AS cpt FROM ' . $db->prefix('news_stories') . ' WHERE ';
Method bodytext
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bodytext($format = 'Show')
{
$myts = \MyTextSanitizer::getInstance();
$html = 1;
$smiley = 1;
Method adminlink
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function adminlink()
{
global $xoopsModule;
$dirname = \basename(\dirname(__DIR__));
/** @var \XoopsModuleHandler $moduleHandler */
Function saveMetagenBlackList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function saveMetagenBlackList(): void
{
$blacklist = new Blacklist();
$words = $blacklist->getAllKeywords();
- 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_news_archives_edit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function b_news_archives_edit($options)
{
global $xoopsDB;
$syear = $smonth = $eyear = $emonth = $older = $recent = 0;
$selsyear = $selsmonth = $seleyear = $selemonth = 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
Function news_updateCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function news_updateCache(): void
{
global $xoopsModule;
$folder = $xoopsModule->getVar('dirname');
$tpllist = [];
- 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 updateCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function updateCache(): void
{
global $xoopsModule;
$folder = $xoopsModule->getVar('dirname');
$tpllist = [];
- 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 renderSelect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function renderSelect($showbutton = false)
{
if ($this->total < $this->perpage) {
return null;
}
- 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 exportNews
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function exportNews(
$fromdate,
$todate,
$topicslist,
$usetopicsdef,
- 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 renderEnhancedSelect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function renderEnhancedSelect($showbutton = false, $titles = null)
{
if ($this->total < $this->perpage) {
return null;
}
- 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 loadSampleData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSampleData(): void
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
$this->initVar('storyid', \XOBJ_DTYPE_INT, null, false, 8);
$this->initVar('uid', \XOBJ_DTYPE_INT, null, false, 5);
Method _searchPreviousOrNextArticle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _searchPreviousOrNextArticle($storyid, $next = true, $checkRight = false)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$ret = [];
Method getAllSubmitted
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAllSubmitted($limit = 0, $asobject = true, $checkRight = false, $start = 0)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$myts = \MyTextSanitizer::getInstance();
Method hometext
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hometext($format = 'Show')
{
$hometext = '';
$myts = \MyTextSanitizer::getInstance();
$html = $smiley = $xcodes = 1;
Method auto_summary
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function auto_summary($text, &$titles)
{
$auto_summary = '';
if (Utility::getModuleOption('enhanced_pagenav')) {
$expr_matches = [];
Method exportNews
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportNews(
$fromdate,
$todate,
$topicslist,
$usetopicsdef,
Method renderEnhancedSelect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderEnhancedSelect($showbutton = false, $titles = null)
{
if ($this->total < $this->perpage) {
return null;
}