Showing 355 of 3,032 total issues
Function getBody
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getBody($maxLength = 0, $format = 'S', $stripTags = '')
{
$ret = $this->getVar('body', $format);
$wrapPos = \mb_strpos($ret, self::PAGEWRAP);
if (!(false === $wrapPos)) {
- 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
File ThemeTabForm.php
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Publisher\Form;
/*
Method publisher_search
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
{
$helper = Helper::getInstance();
$ret = $item = [];
$hightlightKey = '';
Method smarty_modifier_rewrite_url
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_modifier_rewrite_url($url, $insert_param, $param_value = null, $remove_params_arr = '')
{
//parse $insert_param if it is a query string
if (preg_match('/.+=([\w%,-])*/', $insert_param)) {
parse_str($insert_param, $insert_arr);
File item.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
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.
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 cloneFileFolder
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function cloneFileFolder($path): void
{
global $patKeys;
global $patValues;
- 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 toArraySimple
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
{
$itemPageId = -1;
if (\is_numeric($display)) {
$itemPageId = $display;
- 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 publisher_items_random_item_show
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_random_item_show($options)
{
$block = [];
$helper = Helper::getInstance();
Function lofSidernews
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.lofSidernews = function (obj, settings) {
this.settings = {
direction: '',
mainItemSelector: 'li',
navInnerSelector: 'ul',
Method getURL
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
Method resizeImage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeImage()
{
// check file extension
switch ($this->imageMimetype) {
case 'image/png':
Method uploadFile
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uploadFile($another, $withRedirect, &$itemObj = null)
{
\xoops_load('XoopsMediaUploader');
// require_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
Function getURL
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function getURL($url, $tempfile)
{
$this->lastURLError = false;
$url = preg_replace('/ /', '%20', $url);
if (function_exists('curl_init')) {
- 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 selectAll
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function selectAll(formObj, fieldname, isInverse) {
if (fieldname.length == 0) {
for (var i = 0; i < formObj.length; i++) {
fldObj = formObj.elements[i];
if (fldObj.type == 'checkbox') {
- 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 cleanCache
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
- 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 uploadFile
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function uploadFile($another, $withRedirect, &$itemObj = null)
{
\xoops_load('XoopsMediaUploader');
// require_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
- 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 _createInput
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createInput: function () {
var self = this;
var input = document.createElement("input");
input.setAttribute('type', 'file');
Method mergeImage
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeImage(): void
{
$dest = \imagecreatefromjpeg($this->endFile);
$src = \imagecreatefromjpeg($this->sourceFile);
if (4 == $this->mergeType) {
Method isBlockCloned
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
{
\xoops_loadLanguage('admin', 'system');
\xoops_loadLanguage('admin/blocksadmin', 'system');
\xoops_loadLanguage('admin/groups', 'system');