Showing 181 of 2,846 total issues
Function deleteAttachment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAttachment($attach_array = null)
{
/** @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 isResultVisible
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function isResultVisible()
{
$visibleMsg = '';
\xoops_loadLanguage('main', 'xoopspoll');
switch ($this->getVar('visibility')) {
- 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 _parseTime
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_parseTime: function (timeString, withDate) {
if (!this.inst) {
this.inst = $.datepicker._getInst(this.$input[0]);
}
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 displayPostEdit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displayPostEdit()
{
global $myts;
if (empty($GLOBALS['xoopsModuleConfig']['recordedit_timelimit'])) {
Method deleteAttachment
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteAttachment($attach_array = null)
{
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::getInstance();
Function _updateAlternate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.datepicker._updateAlternate = function (inst) {
var tp_inst = this._get(inst, 'timepicker');
if (tp_inst) {
var altField = tp_inst._defaults.altField;
if (altField) { // update alternate field too
Consider simplifying this complex logical expression. Open
if (('add' === $op || 'save' === $op || 'update' === $op)
&& !$topic_obj->getVar('topic_haspoll')
&& ($GLOBALS['xoopsUser'] instanceof \XoopsUser)
&& ($GLOBALS['xoopsUser']->getVar('uid') === $topic_obj->getVar('topic_poster'))) {
$perm = true;
Function getUserbar
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getUserbar()
{
global $xoopsModuleConfig, $xoopsUser, $isadmin;
if (empty($GLOBALS['xoopsModuleConfig']['userbar_enabled'])) {
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 setPostEdit
has a Cognitive Complexity of 9 (exceeds 5 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) {
- 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 delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function delete(\XoopsObject $post, $isDeleteOne = true, $force = false)
{
if (!is_object($post) || 0 == $post->getVar('post_id')) {
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 setPostEdit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setPostEdit($poster_name = '')
{
global $xoopsUser;
/** @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 rcopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rcopy(string $src, string $dest): 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 recurseCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy(string $src, string $dst): void
{
$dir = \opendir($src);
// @mkdir($dst);
if (!@\mkdir($dst) && !\is_dir($dst)) {
- 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 rmove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rmove(string $src, string $dest): 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 create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
create: function (tp_inst, obj, unit, val, min, max, step) {
Method setOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null): void
Function create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
create: function (tp_inst, obj, unit, val, min, max, step) {
Avoid deeply nested control flow statements. Open
if (false === $success) {
$module->setErrors(_AM_XOOPSPOLL_ERROR_COLUMN . 'visibility');
}
Avoid deeply nested control flow statements. Open
for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
gridSize[litem]++;
var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
html += '<td data-for="' + litem + '">' + tmph + '</td>';
}