Showing 113 of 1,244 total issues
Function ToggleBlock
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function ToggleBlock(blockid, icon, src_expand, src_collapse, alt_expand, alt_collapse, class_expand, class_collapse) {
Method getSets
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'set_id',
$order = 'DESC',
Method getLogs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'log_id',
$order = 'DESC',
Method getViews
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
$modules = [],
Function logForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function logForm($options = null)
{
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
$headers = $this->getOptions('', 'title');
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
- 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 clearProxySettings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function clearProxySettings($wrapper = null)
{
$wrappers = isset($wrapper) ? [$wrapper] : array_keys($this->_streamContextOptions);
$clearedWrappers = [];
- 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 getFilesFromFolders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFilesFromFolders($folders = [])
{
list($allFiles, $totalFiles) = $this->userlog->getAllLogFiles();
if (empty($totalFiles)) {
return [];
- 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 getLogsFromFiles
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
$sort = 'log_time',
Function SaveCollapsed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function SaveCollapsed(objid, addcollapsed) {
var collapsed = GetCookie(toggle_cookie);
var tmp = "";
if (collapsed != null) {
collapsed = collapsed.split(",");
- 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 _getUpdateMethod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _getUpdateMethod()
{
// Caches the result
if (null === $this->updateMethod) {
if (null !== $this->localFile) {
- 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 zipFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function zipFiles($log_files = [], $zipFileName = null)
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors('No file to zip');
- 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 userlog_views_edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function userlog_views_edit($options)
{
// require_once XOOPS_ROOT_PATH . "/class/blockform.php"; //reserve for 2.6
xoops_load('XoopsFormLoader');
// $form = new XoopsBlockForm(); //reserve for 2.6
- 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 delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function delete($type = 'log', $period = 0, $limitDel = 0, $criteria = null, $asObject = false)
{
switch ($type) {
case 'log':
if ($asObject) {
- 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 deleteFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function deleteFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- 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 recurseCopy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst)
{
$dir = opendir($src);
// @mkdir($dst);
while (false !== ($file = readdir($dir))) {
- 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 shouldCacheBeUpdated
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function shouldCacheBeUpdated()
{
// Load the cache at the first request
if ($this->_cacheLoaded) {
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
Avoid deeply nested control flow statements. Open
if (is_object($xoopsUser) && !in_array($xoopsUser->getVar('uid'), $perm['super']['uid'])
&& 0 == count(array_intersect($xoopsUser->getGroups(), $perm['super']['group']))) {
$modversion['hasAdmin'] = 0;
$modversion['system_menu'] = 0;
$modversion['tables'] = null;
Function GetCookie
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function GetCookie(name) {
cookie_name = name + "=";
cookie_length = document.cookie.length;
cookie_begin = 0;
while (cookie_begin < cookie_length) {
- 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
while (!feof($remote_handler)) {
$file .= fgets($remote_handler);
}
Method getAll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$type = [],
$start = 0,
$limit = 0,
$sort = 'stats_value',
$order = 'DESC',