Showing 182 of 279 total issues
Function convertorderbyin
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function convertorderbyin($orderby)
{
switch (\trim($orderby)) {
case 'titleA':
$orderby = 'title ASC';
- 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 getUserAverage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUserAverage($criteria = null)
{
$groupby = false;
$field = '';
if (null !== $criteria && $criteria instanceof \CriteriaElement) {
Method addElement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addElement($formElement, $required = false, $row = null, $column = null)
{
if (null === $row) {
$row = $this->_rows;
}
Consider simplifying this complex logical expression. Open
if (!is_object($GLOBALS['xoopsUser'])
&& (_WFDOWNLOADS_ANONPOST_MIRROR == $helper->getConfig('anonpost')
|| _WFDOWNLOADS_ANONPOST_BOTH == $helper->getConfig('anonpost'))
&& (_WFDOWNLOADS_SUBMISSIONS_MIRROR == $helper->getConfig('submissions')
|| _WFDOWNLOADS_SUBMISSIONS_BOTH == $helper->getConfig('submissions'))) {
Function initZoom
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
}}, proto : {initZoom: function () {
var e, n = t.st.zoom, i = ".zoom";
if (n.enabled && t.supportsTransition) {
var o, r, a = n.duration, s = function (e) {
var t = e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), i = "all " + n.duration / 1e3 + "s " + n.easing, o = {position: "fixed", zIndex: 9999, left: 0, top: 0, "-webkit-backface-visibility": "hidden"}, r = "transition";
Method wfdownloads_notify_iteminfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wfdownloads_notify_iteminfo($category, $item_id)
{
global $xoopsModule, $xoopsModuleConfig;
if (empty($xoopsModule) || 'wfdownloads' !== $xoopsModule->dirname()) {
Method getFileStatus
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
{
global $pathIcon16;
if (empty($file_path)) {
Method convertOrderByTrans
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convertOrderByTrans($orderby)
{
$orderbyTrans = '';
if ('title ASC' === $orderby) {
$orderbyTrans = \_MD_WFDOWNLOADS_TITLEATOZ;
Method isNewImage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isNewImage($published)
{
if ($published <= 0) {
$indicator['image'] = 'assets/images/icon/download.gif';
$indicator['alttext'] = \_MD_WFDOWNLOADS_NO_FILES;
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
Function getUserAverage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getUserAverage($criteria = null)
{
$groupby = false;
$field = '';
if (null !== $criteria && $criteria instanceof \CriteriaElement) {
- 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_wfdownloads
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_wfdownloads(XoopsModule $module)
{
global $xoopsModule;
require_once dirname(__DIR__, 3) . '/mainfile.php';
require_once __DIR__ . '/common.php';
Method lettersChoice
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function lettersChoice()
{
$helper = Helper::getInstance();
$criteria = $helper->getHandler('Download')->getActiveCriteria();
Method wfdownloads_top_show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wfdownloads_top_show($options)
{
if (!class_exists(Helper::class)) {
return false;
}
Method convertorderbyout
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convertorderbyout($orderby)
{
if ('title ASC' === $orderby) {
$orderby = 'titleA';
}
Method loadTableFromArrayWithReplace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = XoopsDatabaseFactory::getDatabaseConnection();
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);
Method updateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
Method wfdownloads_search
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function wfdownloads_search($queryArray, $andor, $limit, $offset, $userId = 0, $categories = [], $sortBy = 0, $searchIn = '', $extra = '')
Function initGallery
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
e.magnificPopup.registerModule("gallery", {options: {enabled: !1, arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%"}, proto: {initGallery: function () {
var n = t.st.gallery, i = ".mfp-gallery", r = Boolean(e.fn.mfpFastClick);
return t.direction = !0, n && n.enabled ? (a += " mfp-gallery", x(f + i, function () {
n.navigateByImgClick && t.wrap.on("click" + i, ".mfp-img", function () {
return t.items.length > 1 ? (t.next(), !1) : void 0