Showing 181 of 2,846 total issues
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>';
}
Avoid deeply nested control flow statements. Open
if (this.second <= this._defaults.secondMin) {
this.second = this._defaults.secondMin;
this._defaults.millisecMin = minDateTime.getMilliseconds();
if (this.millisec <= this._defaults.millisecMin) {
this.millisec = this._defaults.millisecMin;
Avoid deeply nested control flow statements. Open
if (this.second >= this._defaults.secondMax) {
this.second = this._defaults.secondMax;
this._defaults.millisecMax = maxDateTime.getMilliseconds();
if (this.millisec >= this._defaults.millisecMax) {
this.millisec = this._defaults.millisecMax;
Function displayPostEdit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function displayPostEdit()
{
global $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
Avoid deeply nested control flow statements. Open
if (false === $success) {
$module->setErrors(_AM_XOOPSPOLL_ERROR_COLUMN . 'visibility');
}
Avoid deeply nested control flow statements. Open
if (overrides.hasOwnProperty(prop) && name[prop]) {
fns[prop] = name[prop];
}
Function getPostsByLimit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function &getPostsByLimit($criteria = null, $limit = 1, $start = 0, $join = null)
{
$ret = [];
$sql = 'SELECT p.*, t.* ' . 'FROM ' . $this->db->prefix('bb_posts') . ' AS p ' . 'LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' AS t ON t.post_id = p.post_id';
if (!empty($join)) {
- 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 getPostsByLimit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function &getPostsByLimit($criteria = null, $limit = 1, $start = 0, $join = null)
{
$ret = [];
$sql = 'SELECT p.*, t.* ' . ' FROM ' . $this->db->prefix('bb_posts') . ' AS p' . ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' AS t ON t.post_id = p.post_id';
if (!empty($join)) {
- 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 getHostByAddrWithCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getHostByAddrWithCache(string &$ipAddr): string
{
static $ipArray = [];
$retVal = &$ipAddr;
$options = ['flags' => \FILTER_FLAG_NO_PRIV_RANGE, \FILTER_FLAG_NO_RES_RANGE];
- 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 getHostByAddrWithCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getHostByAddrWithCache(string &$ipAddr): string
{
static $ipArray = [];
$retVal = &$ipAddr;
$options = ['flags' => \FILTER_FLAG_NO_PRIV_RANGE, \FILTER_FLAG_NO_RES_RANGE];
- 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
Consider simplifying this complex logical expression. Open
if ($oldtitle[$i] !== $title[$i]
|| $oldweight[$i] !== $weight[$i]
|| $oldvisible[$i] !== $visible[$i]
|| $oldside[$i] !== $side[$i]
|| $oldbcachetime[$i] !== $bcachetime[$i]
Consider simplifying this complex logical expression. Open
if ($isadmin || $this->checkIdentity()) {
$post_text = $this->getVar('post_text');
$post_attachment = $this->displayAttachment();
} elseif ($helper->getConfig('enable_karma') && $this->getVar('post_karma') > $user_karma) {
$post_text = "<div class='karma'>" . sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . '</div>';
Consider simplifying this complex logical expression. Open
if (newbb_isAdmin($this->getVar('forum_id')) || $this->checkIdentity()) {
$post['text'] = $post_text . '<br>' . $this->displayAttachment();
} elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
$post['text'] = \sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma'));
} elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $this->getVar('require_reply')
Consider simplifying this complex logical expression. Open
if ($isadmin || $this->checkIdentity()) {
$post_text = $this->getVar('post_text');
$post_attachment = $this->displayAttachment();
} elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
$post_text = "<div class='karma'>" . \sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . '</div>';
Consider simplifying this complex logical expression. Open
if (newbb_isAdmin($this->getVar('forum_id')) || $this->checkIdentity()) {
$post['text'] = $post_text . '<br>' . $this->displayAttachment();
} elseif ($helper->getConfig('enable_karma') && $this->getVar('post_karma') > $user_karma) {
$post['text'] = sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma'));
} elseif ($helper->getConfig('allow_require_reply') && $this->getVar('require_reply')
Function options
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
options: function (tp_inst, obj, unit, opts, val) {
Function options
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
options: function (tp_inst, obj, unit, opts, val) {
Function parseDateTime
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
Function parseDateTimeInternal
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
Method xoopspoll_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function xoopspoll_search($queryArray, mixed $andor, mixed $limit, mixed $offset, $uid): array