Showing 181 of 2,846 total issues
Function parseTime
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.datepicker.parseTime = function (timeFormat, timeString, options) {
var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);
// Strict parse requires the timeString to match the timeFormat exactly
Function insert
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $post, $force = true)
{
global $xoopsUser;
// Set the post time
- 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 insert
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $post, $force = true)
{
// Set the post time
// The time should be 'publish' time. To be adjusted later
if (!$post->getVar('post_time')) {
- 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
File main.php
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
if (defined('MAIN_DEFINED')) {
return;
}
Function showPost
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function showPost($isadmin)
{
global $xoopsConfig, $xoopsModule, $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
Method showPost
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showPost($isadmin)
{
global $xoopsConfig, $xoopsModule, $xoopsUser, $myts;
/** @var Xoopspoll\Helper $helper */
$helper = Xoopspoll\Helper::getInstance();
Function _newInst
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
_newInst: function ($input, opts) {
var tp_inst = new Timepicker(),
inlineSettings = {},
fns = {},
overrides, i;
Function xoopspollBlockMultiShow
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
function xoopspollBlockMultiShow(array $options): array
{
$block = [];
$pollOptionArray = [];
/** @var \XoopsModuleHandler $moduleHandler */
- 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 listBlocks
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function listBlocks(): void
{
$pathIcon16 = Admin::iconUrl('', '16');
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
- 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 xoopspollBlockSinglepollShow
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopspollBlockSinglepollShow(mixed $options): array
{
$block = [];
/** @var \XoopsConfigHandler $configHandler */
Method xoopspollBlockMultiShow
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopspollBlockMultiShow(array $options): array
{
$block = [];
$pollOptionArray = [];
/** @var \XoopsModuleHandler $moduleHandler */
Function strictParse
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
var strictParse = function (f, s, o) {
// pattern for standard and localized AM/PM markers
var getPatternAmpm = function (amNames, pmNames) {
var markers = [];
Method xoopspollBlockSinglepollEdit
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopspollBlockSinglepollEdit(mixed $options): string
{
/**
* Options[]
* 0 = show expired polls in block
Method _delete
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _delete($post, $force = false)
{
if ((!$post instanceof Post) || (0 === $post->getVar('post_id'))) {
return false;
}
Method render
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): string
{
static $included = false;
$ele_name = $this->getName();
File Poll.php
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Xoopspoll;
/*
Function _onTimeChange
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onTimeChange: function () {
if (!this._defaults.showTimepicker) {
return;
}
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
Method render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
Function xoopspollBlockSinglepollEdit
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function xoopspollBlockSinglepollEdit(mixed $options): string
{
/**
* Options[]
* 0 = show expired polls in block
- 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 insert
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(\XoopsObject $post, $force = true)
{
// Set the post time
// The time should be 'publish' time. To be adjusted later
if (!$post->getVar('post_time')) {