Showing 216 of 316 total issues
Method removeAccents
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function removeAccents($string)
{
$chars['in'] = \chr(128)
. \chr(131)
. \chr(138)
Method DefinitionImport
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $myts;
$myts = \MyTextSanitizer::getInstance();
Method categoryEdit
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function categoryEdit($categoryID = '')
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
require_once XOOPS_ROOT_PATH . '/class/uploader.php';
require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
Function updateBlock
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
{
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
- 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 DefinitionImport
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $myts;
$myts = \MyTextSanitizer::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 positiontip
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function positiontip(e) {
if (enabletip) {
var nondefaultpos = false;
var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
- 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 categorySave
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function categorySave($categoryID = '')
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
require_once XOOPS_ROOT_PATH . '/class/uploader.php';
global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB, $myts, $categoryID;
Method __construct
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($target)
{
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$helper = Helper::getInstance();
$utility = new Utility();
Function lx_extract_keywords
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function lx_extract_keywords($content)
{
global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig;
require_once XOOPS_ROOT_PATH . '/modules/lexikon/include/common.inc.php';
$keywords_count = $helper->getConfig('metakeywordsnum');
- 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 extractKeywords
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function extractKeywords($content)
{
global $xoopsTpl, $xoTheme, $xoopsModule;
$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
Function checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule($helper, $source = 'github', $default = 'master')
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
$update = '';
- 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 functions.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: lexikon
* Author: Yerres
* Licence: GNU
Method lx_GetStatistics
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lx_GetStatistics($limit)
{
$ret = [];
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$tbls = $db->prefix('lxentries');
Method categoryDefault
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function categoryDefault()
{
$helper = Helper::getInstance();
$op = 'default';
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
Method myblocksadmin_update_block
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function myblocksadmin_update_block(
$bid,
$bside,
$bweight,
$bvisible,
Function lx_module_header
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function lx_module_header()
{
global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig, $lexikon_module_header;
if (isset($xoTheme) && is_object($xoTheme)) {
$xoTheme->addStylesheet('modules/lexikon/assets/css/style.css');
- 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 isBlockCloned
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
{
xoops_loadLanguage('admin', 'system');
xoops_loadLanguage('admin/blocksadmin', 'system');
xoops_loadLanguage('admin/groups', 'system');
- 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 getModuleHeader
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleHeader()
{
global $xoopsTpl, $xoTheme, $xoopsModule, $lexikon_module_header;
$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 truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Method truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {