Showing 155 of 201 total issues
Function OnPreview
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function OnPreview(n, sUrl) {
var prevID = n;
var preview;
if (!ns6) {
preview = document.getElementById("id" + prevID).innerText;
- 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
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Avoid deeply nested control flow statements. Open
if ($chcount > 5) {
$subcategories .= '...';
break;
}
Method wfl_address
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
Function pagerank
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function pagerank($url)
{
$pagerank = '';
$ch = '6' . static::googleCh(static::strord('info:' . $url));
$fp = \fsockopen('www.google.com', 80, $errno, $errstr, 30);
- 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
Consider simplifying this complex logical expression. Open
if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && 'modulesadmin' === $_POST['fct']
&& 'update_ok' === $_POST['op']
&& $_POST['dirname'] == $modversion['dirname']) {
require_once __DIR__ . '/include/onupdate.inc.php';
}
Method setName
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setName($family = '', $first = '', $additional = '', $prefix = '', $suffix = '')
Method wflinks_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function wflinks_search($queryarray, $andor, $limit, $offset, $userid)
Method createThumb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$img_width = null,
$img_height = null,
$img_quality = null,
$img_update = null,
$img_aspect = null
Function clb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function clb(u, a, t, p, n) {
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Function wflinks_search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function wflinks_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB, $xoopsUser;
$sql = 'SELECT cid, pid FROM ' . $xoopsDB->prefix('wflinks_cat');
- 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 b_wflinks_banner_show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function b_wflinks_banner_show($options)
{
$moduleDirName = basename(__DIR__);
global $xoopsDB;
- 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 setLabel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setLabel(
$postoffice = '',
$extended = '',
$street = '',
$city = '',
- 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 _renderOptionTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
{
$tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
// If there are parent elements, add javascript that will
// make them selecteded when this element is checked to make
- 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 getEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getEditor($helper = null, $options = null)
{
/** @var Helper $helper */
if (null === $options) {
$options = [];
- 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 getHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getHandler($name, $optional = false)
{
global $handlers, $xoopsModule;
$name = mb_strtolower(\trim($name));
- 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 fetchURL
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function fetchURL($url, $timeout = 2)
{
/** @var Helper $helper */
$helper = Helper::getInstance();
$url = urldecode($url);
- 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
Avoid too many return
statements within this method. Open
return DEFAULT_PATH;
Avoid too many return
statements within this method. Open
return $item;