Showing 32 of 478 total issues
Function xoops_module_update_myconference
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_myconference(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$capsDirName = strtoupper($moduleDirName);
- 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 deleteDirectory
has a Cognitive Complexity of 22 (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
Method getFile
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getFile($file)
{
require_once XOOPS_ROOT_PATH . '/class/uploader.php';
$mimetypes = [
'image/gif',
Method xoops_module_update_myconference
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_myconference(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$capsDirName = strtoupper($moduleDirName);
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
$ret = '';
//
if (!$this->caseSensitive) {
- 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 getConfig
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getConfig()
{
$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = strtoupper($moduleDirName);
return (object)[
Method render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$ret = '';
//
if (!$this->caseSensitive) {
Method createThumbs
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createThumbs($filename)
{/*
require_once('phpthumb/phpthumb.class.php');
$thumbnail_widths = array(150, 400);
foreach ($thumbnail_widths as $thumbnail_width) {
Function createThumbs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function createThumbs($filename)
{/*
require_once('phpthumb/phpthumb.class.php');
$thumbnail_widths = array(150, 400);
foreach ($thumbnail_widths as $thumbnail_width) {
- 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 imageSave
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function imageSave()
{
// Function that takes the data from the form and, in case of a
// new image, uploads the file to the appropriate directory and
// creates the record in the database; if it is an edit, the
- 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 makeMySelBox
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
{
if ('' == $sel_name) {
$sel_name = $this->id;
}
Function recurseCopy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst)
{
$dir = opendir($src);
// @mkdir($dst);
if (!mkdir($dst) && !is_dir($dst)) {
- 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 makeMySelBox
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
{
if ('' == $sel_name) {
$sel_name = $this->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"
Further reading
Method xoops_module_install_myconference
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_myconference(\XoopsModule $module)
{
require_once __DIR__ . '/../../../mainfile.php';
require_once __DIR__ . '/../include/config.php';
Function rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir($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
Method getServerStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats()
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = basename(dirname(dirname(__DIR__)));
$moduleDirNameUpper = strtoupper($moduleDirName);
Method lettersChoice
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
{
/*
$pedigree = PedigreePedigree::getInstance();
xoops_load('XoopsLocal');
Function rmdirr
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function rmdirr($dirname)
{
// Simple delete for a file
if (is_file($dirname)) {
return unlink($dirname);
- 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 deleteDirectory
has 26 lines of code (exceeds 25 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;
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$objHandler,
$criteria = null,
$field_name = null,
$alphabet = [],
$arg_name = 'letter',