Showing 691 of 1,163 total issues
Function keyHandler
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
keyHandler: function (e) {
if (!e) e = window.event;
if (!e.target) e.target = e.srcElement; // ie
if (typeof e.target.form != 'undefined') return true; // form element has focus
if (!hs.fireEvent(hs, 'onKeyDown', e)) 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"
Further reading
Function Expander
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
hs.Expander = function (a, params, custom, contentType) {
if (document.readyState && hs.ie && !hs.isReady) {
hs.addEventListener(document, 'ready', function () {
new hs.Expander(a, params, custom, contentType);
});
- 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 getRecurEventToDisplay
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public function getRecurEventToDisplay($event, $periodStart, $periodEnd)
{
$recuEvents = [];
$eventOptions = \explode('|', $event['event_recur_rules']);
- 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
hs
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
var hs = {
// Language strings
lang: {
cssDirection: 'ltr',
loadingText: 'Loading...',
Function keyHandler
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
keyHandler: function (e) {
if (!e) e = window.event;
if (!e.target) e.target = e.srcElement; // ie
if (typeof e.target.form != 'undefined') return true; // form element has focus
var exp = hs.getExpander();
- 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 Expander
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
hs.Expander = function (a, params, custom, contentType) {
if (document.readyState && hs.ie && !hs.isReady) {
hs.addEventListener(document, 'ready', function () {
new hs.Expander(a, params, custom, contentType);
});
- 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 PclTarHandleAddList
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
{
TrFctStart(__FILE__, __LINE__, 'PclTarHandleAddList', "tar='$p_tar', list, mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
$v_result = 1;
$v_header = [];
- 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 mouseClickHandler
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
mouseClickHandler: function (e) {
if (!e) e = window.event;
if (e.button > 1) return true;
if (!e.target) e.target = e.srcElement;
- 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 mouseClickHandler
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
mouseClickHandler: function (e) {
if (!e) e = window.event;
if (e.button > 1) return true;
if (!e.target) e.target = e.srcElement;
- 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 addEventToCalArray
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function addEventToCalArray(&$event, &$eventsArray, $startPeriod, $endPeriod)
{
global $timeHandler, $xoopsUser, $month, $year;
// Calculating the start and the end of the event
- 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 44 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = false, $checkObject = true)
{
if (false !== $checkObject) {
if (!\is_object($obj)) {
// var_dump($obj);
- 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 objectToArray
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function objectToArray($objects, $externalKeys = [], $format = 's')
{
static $cache;
if (!\is_array($externalKeys)) {
$externalKeys = [$externalKeys];
- 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 changeSize
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
changeSize: function (up, to, dur) {
// transition
var trans = this.transitions,
other = up ? (this.last ? this.last.a : null) : hs.upcoming,
t = (trans[1] && other
- 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
EventHandler
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
class EventHandler extends ExtcalPersistableObjectHandler
{
private $extcalPerm;
private $extcalTime;
Function showHideElements
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
showHideElements: function (tagName, visibility) {
var els = document.getElementsByTagName(tagName);
var prop = tagName == '*' ? 'overflow' : 'visibility';
for (var i = 0; i < els.length; i++) {
if (prop == 'visibility' || (document.defaultView.getComputedStyle(
- 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 showHideElements
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
showHideElements: function (tagName, visibility) {
var els = document.getElementsByTagName(tagName);
var prop = tagName == '*' ? 'overflow' : 'visibility';
for (var i = 0; i < els.length; i++) {
if (prop == 'visibility' || (document.defaultView.getComputedStyle(
- 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 PclTarMerge
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PclTarMerge($p_tarname, $p_tarname_add, $p_mode = '', $p_mode_add = '')
{
TrFctStart(__FILE__, __LINE__, 'PclTarMerge', "tar='$p_tarname', tar_add='$p_tarname_add', mode='$p_mode', mode_add='$p_mode_add'");
$v_result = 1;
Function listBlocks
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function listBlocks()
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$moduleDirName = \basename(\dirname(__DIR__));
- 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 PclTarHandleAppend
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
{
TrFctStart(__FILE__, __LINE__, 'PclTarHandleAppend', "tar=$p_tarname, list, mode=$p_mode");
$v_result = 1;
- 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 getRecurEventToDisplay
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRecurEventToDisplay($event, $periodStart, $periodEnd)
{
$recuEvents = [];
$eventOptions = \explode('|', $event['event_recur_rules']);