Showing 93 of 115 total issues
Method xoops_module_update_mymenus
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_mymenus(\XoopsObject $xoopsModule, $previousVersion)
{
if ($previousVersion < 151) {
//if (!checkInfoTemplates($xoopsModule)) return false;
if (!Updater::checkInfoTable($xoopsModule)) {
Function deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory($src)
{
// 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 render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function render(?array $block = null)
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 getModuleMenus
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function getModuleMenus($module, $pid)
{
global $xoopsModule;
static $id = -1;
/** @var \XoopsModules\Mymenus\Helper $helper */
Method isBlockCloned
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
{
\xoops_loadLanguage('admin', 'system');
\xoops_loadLanguage('admin/blocksadmin', 'system');
\xoops_loadLanguage('admin/groups', 'system');
Function mymenus_block_edit
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function mymenus_block_edit($options)
{
/** @var \XoopsModules\Mymenus\Helper $helper */
$helper = 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 render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
// load all child ids for javascript codes
foreach (\array_keys($this->_itemTree) as $item_id) {
$this->_itemTree[$item_id]['allchild'] = [];
Function editLink
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function editLink($id = null, $pid = null, $mid = null)
{
$helper = Helper::getInstance();
//
// Disable xoops debugger in dialog window
- 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 hoverIntent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
// default configuration values
var cfg = {
interval: 100,
Function hoverIntent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
// default configuration values
var cfg = {
interval: 100,
Method orderBlock
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
array $oldvisible,
Method getSkinInfo
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $themeSkin = '')
{
// require __DIR__ . '/common.php';
/** @var \XoopsModules\Mymenus\Helper $helper */
$helper = Helper::getInstance();
Method getFormFeedback
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormFeedback($action = false)
{
if (false === $action) {
$action = $_SERVER['REQUEST_URI'];
}
Function toArray
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
toArray: function (options) {
var o = $.extend({}, this.options, options),
sDepth = o.startDepthCount || 0,
ret = [],
Method addLink
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function addLink($mid): void
{
$helper = Helper::getInstance();
if (!$GLOBALS['xoopsSecurity']->check()) {
Method checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
Method updateBlock
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
: void {
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Function loadTableFromArrayWithReplace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
- 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 supersubs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.supersubs = function(options){
var opts = $.extend({}, $.fn.supersubs.defaults, options);
// return original object to support chaining
return this.each(function() {
// cache selections
Function supersubs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.supersubs = function(options){
var opts = $.extend({}, $.fn.supersubs.defaults, options);
// return original object to support chaining
return this.each(function() {
// cache selections