Showing 181 of 2,846 total issues
Method renderOptionFormTray
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderOptionFormTray(int $pid = 0): \XoopsFormElementTray
{
\xoops_load('xoopsformloader');
$pid = (int)$pid;
$barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/xoopspoll/assets/images/colorbars/'));
Method checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
Function handleActions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function handleActions(BlockData $blockData)
{
$moduleDirNameUpper = \mb_strtoupper(Helper::getInstance()->getDirname());
$bid = Request::getInt('bid', 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 isBlockCloned
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups, bool $redirect = true)
{
\xoops_loadLanguage('admin', 'system');
\xoops_loadLanguage('admin/blocksadmin', 'system');
\xoops_loadLanguage('admin/groups', 'system');
- 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 approve
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function approve(&$post, $force = false)
{
if (empty($post)) {
return false;
}
- 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 getPostBody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function &getPostBody()
{
global $myts;
$GLOBALS['xoopsModuleConfig'] = newbb_load_config(); // irmtfan load all newbb configs - newbb config in blocks activated in some modules like profile
// mod_loadFunctions('user', 'newbb');
- 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 getPostBody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function &getPostBody()
{
global $xoopsConfig, $xoopsUser, $myts;
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::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 loadTableFromArrayWithReplace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace(string $table, array $data, string $search, $replace): int
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
- 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 handleActions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleActions(BlockData $blockData)
{
$moduleDirNameUpper = \mb_strtoupper(Helper::getInstance()->getDirname());
$bid = Request::getInt('bid', 0);
Method cloneBlock
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cloneBlock(int $bid)
{
//require __DIR__ . '/admin_header.php';
// \xoops_cp_header();
Method editBlock
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function editBlock(int $bid): void
{
// require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
// \xoops_cp_header();
\xoops_loadLanguage('admin', 'system');
Method assignForm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function assignForm(\XoopsTpl $tpl): void
{
$myts = \MyTextSanitizer::getInstance();
$optionObjs = $this->optionHandler->getAllByPollId($this->pollObj->getVar('poll_id'));
Method vote
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function vote(int $optionId, string $ip, int $time): bool
{
if (!empty($optionId) && $this->isAllowedToVote()) {
$voteTime = empty($time) ? \time() : (int)$time;
$uid = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
Method getPostBody
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function &getPostBody()
{
global $xoopsConfig, $xoopsUser, $myts;
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::getInstance();
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 displayAttachment
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function displayAttachment($asSource = false)
{
global $xoopsModule;
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::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 getPostBody
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function &getPostBody()
{
global $myts;
$GLOBALS['xoopsModuleConfig'] = newbb_load_config(); // irmtfan load all newbb configs - newbb config in blocks activated in some modules like profile
// mod_loadFunctions('user', 'newbb');
Method orderBlock
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($id = null)
{
parent::__construct();
// $timestamp = xoops_getUserTimestamp(time());
$currentTimestamp = \time();
Method hasVoted
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hasVoted(?int $pid, string $ip, int $uid = 0): bool
{
$uid = (int)$uid;
$pid = (int)$pid;
$voted = true;