Showing 374 of 649 total issues
Function checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$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
Function orderBlock
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
- 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 parseCSSStyleExtras
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseCSSStyleExtras(pf, i, ar) {
var k = i;
if (k < ar.length) {
if (ar[k] == CSSSTYLE) {
eval(pf + 'css=' + ar[k]);
Function parseCSSStyleExtras
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseCSSStyleExtras(pf, i, ar) {
var k = i;
if (k < ar.length) {
if (ar[k] == CSSSTYLE) {
Method myblocksadmin_update_block
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function myblocksadmin_update_block(
$bid,
$bside,
$bweight,
$bvisible,
Function addSrcToDestList
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for (var i = 0; i < srcList.length; i++) {
- 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) {
File Answer.php
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Smartfaq;
/**
Method getObjectsAdminSide
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getObjectsAdminSide(\CriteriaElement $criteria = null, $id_as_key = false, $notNullFields = '')
{
$ret = [];
$limit = $start = 0;
$sql = 'SELECT
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 getLinkedUnameFromId
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function getLinkedUnameFromId($userid = 0, $name = 0, $users = [])
{
if (!\is_numeric($userid)) {
return $userid;
}
- 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 displayAttachment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function displayAttachment($asSource = false)
{
global $xoopsModule;
/** @var Smartfaq\Helper $helper */
$helper = Smartfaq\Helper::getInstance();
- 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
FaqHandler
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class FaqHandler extends \XoopsObjectHandler
{
protected $helper;
/**
Method getContextualFaqs
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getContextualFaqs($limit = 0)
{
$ret = false;
$otherCriteria = new \CriteriaCompo();
File question.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/**
* Module: SmartFAQ
* Author: The SmartFactory <www.smartfactory.ca>
Function getFaqs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getFaqs(
$limit = 0,
$start = 0,
$status = '',
$categoryid = -1,
- 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 getObjects
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getObjects(\CriteriaElement $criteria = null, $id_as_key = false, $notNullFields = '')
{
$ret = [];
$limit = $start = 0;
$sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq');
- 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 render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function render(?array $block = null)
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 getObjectsAdminSide
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getObjectsAdminSide(\CriteriaElement $criteria = null, $id_as_key = false, $notNullFields = '')
{
$ret = [];
$limit = $start = 0;
$sql = 'SELECT
- 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 reOrder
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reOrder(hookPt, fnRef, order) {
if (!order || typeof order == 'undefined' || typeof order == 'number') return;
var newPt = new Array(), match;