Showing 236 of 310 total issues
Method getRandomNews
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$checkRight = false,
$topic = 0,
$ihome = 0,
Method exportNews
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$fromdate,
$todate,
$topicslist,
$usetopicsdef,
&$tbltopics,
Method getBigStory
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$checkRight = false,
$topic = 0,
$ihome = 0,
Method makeMyTopicSelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$none = 0,
$seltopic = -1,
$selname = '',
$onchange = '',
$checkRight = false,
Method news_getWysiwygForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
Method makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
Function replace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function replace($replace_matches)
{
$patterns = [];
if ($this->singlewords) {
$keywords = \explode(' ', $this->preg_keywords);
- 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);
}
Method getWysiwygForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
Function newSubmissions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function newSubmissions(): void
{
global $dateformat, $pathIcon16;
$start = Request::getInt('startnew', 0, 'GET');
$newsubcount = NewsStory::getAllStoriesCount(3, 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
Method news_resizePicture
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$src_path,
$dst_path,
$param_width,
$param_height,
$keep_original = false,
Method makeSelBoxOptions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function makeSelBoxOptions($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr = ''): void
Function deleteBeforeDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function deleteBeforeDate($timestamp, $expired, $topicslist = '')
{
global $xoopsModule;
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
- 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 resizePicture
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$src_path,
$dst_path,
$param_width,
$param_height,
$keep_original = false,
Avoid deeply nested control flow statements. Open
if (!unlink($currentPicture)) {
trigger_error('Error, impossible to delete the picture attached to this article');
}
Function getArchive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getArchive(
$publish_start,
$publish_end,
$checkRight = false,
$asobject = true,
- 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 (!$sfiles->store()) {
echo _AM_UPLOAD_DBERROR_SAVE;
}
Function countPublishedByTopic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function countPublishedByTopic($topicid = 0, $checkRight = false)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$sql = 'SELECT COUNT(*) FROM ' . $db->prefix('news_stories') . ' WHERE published > 0 AND published <= ' . \time() . ' AND (expired = 0 OR expired > ' . \time() . ')';
- 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 (file_exists($newName)) {
@unlink($fullPictureName);
rename($newName, $fullPictureName);
}
Consider simplifying this complex logical expression. Open
if ($oldtitle[$i] !== $title[$i]
|| $oldweight[$i] !== $weight[$i]
|| $oldvisible[$i] !== $visible[$i]
|| $oldside[$i] !== $side[$i]
|| $oldbcachetime[$i] !== $bcachetime[$i]