Showing 49 of 63 total issues
Function saveLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function saveLink($id, $mid)
{
/** @var \XoopsModules\Mymenus\Helper $helper */
$helper = \XoopsModules\Mymenus\Helper::getInstance();
/** @var \XoopsModules\Mymenus\LinksHandler $linksHandler */
- 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 createTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ddtreemenu.createTree = function (treeid, enablepersist, persistdays) {
var ultags = document.getElementById(treeid).getElementsByTagName("ul");
if (typeof persisteduls[treeid] == "undefined")
persisteduls[treeid] = (enablepersist == true && ddtreemenu.getCookie(treeid) != "") ? ddtreemenu.getCookie(treeid).split(",") : "";
for (var i = 0; i < ultags.length; i++)
- 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 (parentItem != null && nextItem === null &&
(o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
!o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
parentItem.after(this.placeholder[0]);
this._clearEmpty(parentItem[0]);
Function addLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function addLink($mid)
{
/** @var \XoopsModules\Mymenus\Helper $helper */
$helper = \XoopsModules\Mymenus\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 flatten
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ddtreemenu.flatten = function (treeid, action) { //expand or contract all UL elements
var ultags = document.getElementById(treeid).getElementsByTagName("ul");
for (var i = 0; i < ultags.length; i++) {
ultags[i].style.display = (action == "expand") ? "block" : "none";
var relvalue = (action == "expand") ? "open" : "closed";
- 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 xoops_module_install_mymenus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_mymenus(\XoopsModule $module)
{
require dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
require dirname(__DIR__) . '/include/config.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
Function eventEnd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function eventEnd()
{
$newmenus = [];
$registry = Mymenus\Registry::getInstance();
$menus = $registry->getEntry('menus');
- 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 checkInfoTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function checkInfoTable(\XoopsObject $module)
{
// global $xoopsDB;
$err = 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 setPlugins
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setPlugins()
{
if (is_dir($dir = $GLOBALS['xoops']->path("modules/{$this->helper->getDirname()}/class/Plugins/"))) {
$pluginsList = \XoopsLists::getDirListAsArray($dir);
foreach ($pluginsList as $plugin) {
- 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"