File onupdate.php
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
Method update_tables_to_322
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_tables_to_322($module)
{
$dbupdater = new Wfdownloads\Dbupdater();
// create wfdownloads_meta table
Function xoops_module_update_wfdownloads
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_wfdownloads(XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = mb_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
Method update_tables_to_323
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_tables_to_323(XoopsModule $module)
{
$dbupdater = new Wfdownloads\Dbupdater();
// update wfdownloads_downloads table
Method xoops_module_update_wfdownloads
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_wfdownloads(XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
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
Method invert_nohtm_dohtml_values
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function invert_nohtm_dohtml_values()
{
$ret = [];
$categoriesHandler = $helper->getHandler('Category');
$result = $GLOBALS['xoopsDB']->query('SHOW COLUMNS FROM ' . $categoriesHandler->table);
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Function get_table_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_table_info($table, $default_fields)
{
$result = $GLOBALS['xoopsDB']->query('SHOW COLUMNS FROM ' . $table);
while (false !== ($existing_field = $GLOBALS['xoopsDB']->fetchArray($result))) {
$fields[$existing_field['Field']] = $existing_field['Type'];
- 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_permissions_to_323
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function update_permissions_to_323(XoopsModule $module)
{
/** @var \XoopsGroupPermHandler $grouppermHandler */
$grouppermHandler = xoops_getHandler('groupperm');
/** @var Wfdownloads\CategoryHandler $categoriesHandler */
- 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"