Showing 181 of 2,846 total issues
Function _getDateDatepicker
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.datepicker._getDateDatepicker = function (target, noDefault) {
var inst = this._getInst(target);
if (!inst) {
return;
}
Method delete
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete($post, $isDeleteOne = true, $force = false)
{
$retVal = false;
if (($post instanceof Post) && ($post->getVar('post_id') > 0)) {
if ($isDeleteOne) {
Method isResultVisible
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isResultVisible()
{
$visibleMsg = '';
\xoops_loadLanguage('main', 'xoopspoll');
switch ($this->getVar('visibility')) {
Method processOrderBlockAction
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processOrderBlockAction(BlockData $blockData)
{
$blockData->bid = Request::getArray('bid', []);
$blockData->oldtitle = Request::getArray('oldtitle', [], 'POST');
$blockData->oldside = Request::getArray('oldside', [], 'POST');
Function hasVoted
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function hasVoted(?int $pid, string $ip, int $uid = 0): bool
{
$uid = (int)$uid;
$pid = (int)$pid;
$voted = true;
- 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 assignResults
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function assignResults(\XoopsTpl $tpl): void
{
$myts = \MyTextSanitizer::getInstance();
$xuEndTimestamp = \xoops_getUserTimestamp($this->pollObj->getVar('end_time'));
$xuEndFormatted = \ucfirst(\date(_MEDIUMDATESTRING, (int)$xuEndTimestamp));
- 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 rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir(string $src): bool
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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 mailResults
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function mailResults(mixed $pollObj = null): array
{
$criteria = new \CriteriaCompo();
$criteria->add(new \Criteria('end_time', \time(), '<')); // expired polls
$criteria->add(new \Criteria('mail_status', Constants::POLL_NOT_MAILED, '=')); // email not previously sent
- 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 getServerStats
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats(): string
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method loadTableFromArrayWithReplace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace(string $table, array $data, string $search, $replace): int
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
Function _setDateDatepicker
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.datepicker._setDateDatepicker = function (target, _date) {
var inst = this._getInst(target);
var date = _date;
if (!inst) {
return;
Method setPostEdit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPostEdit($poster_name = '')
{
global $xoopsUser;
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::getInstance();
Function looseParse
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var looseParse = function (f, s, o) {
try {
var d = new Date('2012-01-01 ' + s);
if (isNaN(d.getTime())) {
d = new Date('2012-01-01T' + s);
Method b_marquee_xoopspoll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_xoopspoll($limit, $dateformat, $itemssize)
{
require_once $GLOBALS['xoops']->path('modules/marquee/include/functions.php');
$block = [];
$myts = \MyTextSanitizer::getInstance();
Method updateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
Method isBlockCloned
has 9 arguments (exceeds 4 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)
Method setPostEdit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPostEdit($poster_name = '', $post_editmsg = '')
{
if ($this->getVar('approved') < 1
|| empty($GLOBALS['xoopsModuleConfig']['recordedit_timelimit'])
|| (\time() - $this->getVar('post_time')) < $GLOBALS['xoopsModuleConfig']['recordedit_timelimit'] * 60) {
Method setVoteCookie
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setVoteCookie($index, string $value, int $expires = 0, string $cookieBaseName = 'voted_polls'): bool
{
$pollDir = \basename(\dirname(__DIR__));
$success = false;
// do a little sanity check on $index and $cookieBaseName
Method setVoteCookie
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setVoteCookie($index, string $value, int $expires = 0, string $cookieBaseName = 'voted_polls'): bool
{
$pollDir = \basename(\dirname(__DIR__));
$success = false;
// do a little sanity check on $index and $cookieBaseName
Function deleteAttachment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAttachment($attach_array = null)
{
$attach_old = $this->getAttachment();
if (!\is_array($attach_old) || \count($attach_old) < 1) {
return true;
- 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"