Showing 188 of 2,792 total issues
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 getListTypeAsArray
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
{
$filelist = [];
switch (\trim($type)) {
case 'images':
- 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 getListTypeAsArray
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function &getListTypeAsArray()
{
$filelist = [];
switch (\trim($this->type)) {
case 'images':
- 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 submit.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: XoopsTube
*
Method resizeThumbnail
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeThumbnail()
{
// Get image size and scale ratio
$scale = \min($this->img_width / $this->_img_info[0], $this->img_height / $this->_img_info[1]);
// If the image is larger than the max shrink it
Function cleanRequestVars
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function cleanRequestVars(
&$array,
$name = null,
$def = null,
$strict = 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 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
Method getTotalItems
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTotalItems($sel_id = 0, $get_child = 0, $return_sql = 0)
{
global $mytree, $_check_array;
if ($sel_id > 0) {
Function isBlockCloned
has a Cognitive Complexity of 20 (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
Method getSpotlightVideos
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSpotlightVideos($options)
{
require_once dirname(__DIR__) . '/include/video.php';
$block = [];
/** @var \XoopsModuleHandler $moduleHandler */
Function xtubeShowVideo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function xtubeShowVideo($vidid, $source, $screenshot, $picurl)
{
global $xoopsModule;
$showvideo = '';
$autoplay = $GLOBALS['xoopsModuleConfig']['autoplay'];
- 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 resizeThumbnail
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function resizeThumbnail()
{
// Get image size and scale ratio
$scale = \min($this->img_width / $this->_img_info[0], $this->img_height / $this->_img_info[1]);
// If the image is larger than the max shrink it
- 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 showTopVideoBlock
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showTopVideoBlock($options)
{
$moduleDirName = \basename(\dirname(__DIR__));
$block = [];
/** @var \XoopsModuleHandler $moduleHandler */
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 showTopVideoBlock
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function showTopVideoBlock($options)
{
$moduleDirName = \basename(\dirname(__DIR__));
$block = [];
/** @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 getSpotlightVideos
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function getSpotlightVideos($options)
{
require_once dirname(__DIR__) . '/include/video.php';
$block = [];
/** @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
Method render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($alphaCount = null, $howmanyother = null)
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
\xoops_loadLanguage('common', $moduleDirName);
Method fetchMedia
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetchMedia($media_name, $index = null)
{
global $_FILES;
if (!isset($_FILES[$media_name])) {
Function getBannerFromClientId
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function getBannerFromClientId($client_id)
{
###### Hack by www.stefanosilvestrini.com ######
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$bresult = $db->query('SELECT COUNT(*) FROM ' . $db->prefix('banner') . ' WHERE cid=' . $client_id);
- 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"