Showing 182 of 279 total issues
Method cloneBlock
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cloneBlock($bid)
{
require_once __DIR__ . '/admin_header.php';
xoops_cp_header();
Method editBlock
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editBlock($bid)
{
require_once __DIR__ . '/admin_header.php';
xoops_cp_header();
$adminObject = Admin::getInstance();
Method approveModification
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function approveModification($requestid)
{
$sql = "UPDATE {$this->table} m, {$this->helper->getHandler('Download')->table} d";
$sql .= " SET
d.cid = m.cid,
Method getListTypeAsArray
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
{
$filelist = [];
switch (\trim($type)) {
case 'images':
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function render($alphaCount = null, $howmanyother = null)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
\xoops_loadLanguage('common', $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 update_tables_to_322
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function update_tables_to_322($module)
{
$dbupdater = new Wfdownloads\Dbupdater();
// create wfdownloads_meta table
- 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 getForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getForm($action = false)
{
$grouppermHandler = \xoops_getHandler('groupperm');
if (!$action) {
- 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 wfdownloads_top_by_cat_show
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function wfdownloads_top_by_cat_show($options)
{
if (!class_exists(Helper::class)) {
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 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
Method convertHtml2text
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convertHtml2text($document)
{
$search = [
"'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'<img.*?>'si", // Strip out img tags
Function open
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, open : function (n) {
i || (i = e(document.body));
var r;
if (n.isObj === !1) {
t.items = n.items.toArray(), t.index = 0;
Method getServerStats
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats()
{
//mb /** @var \XoopsModules\Wfdownloads\Helper $helper */
//mb $helper = \XoopsModules\Wfdownloads\Helper::getInstance();
$moduleDirName = \basename(dirname(__DIR__, 2));
Method wfdownloads_createLogo
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wfdownloads_createLogo($dirname)
{
$helper = Helper::getInstance();
// Check extension/functions
if (!extension_loaded('gd')) {
Method convertorderbyin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convertorderbyin($orderby)
{
switch (\trim($orderby)) {
case 'titleA':
$orderby = 'title ASC';
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;
}
Method displayIcons
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function displayIcons($time, $status = \_WFDOWNLOADS_STATUS_WAITING, $counter = 0)
{
$helper = Helper::getInstance();
$new = '';
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 getDirListAsArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getDirListAsArray($dirname)
{
$dirlist = [];
if (\is_dir($dirname) && $handle = \opendir($dirname)) {
while (false !== ($file = \readdir($handle))) {
- 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
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"