Showing 113 of 1,244 total issues
Function arrayToDisplay
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function arrayToDisplay($logs, $skips = [])
{
foreach ($logs as $log_id => $log) {
$logs[$log_id]['log_time'] = $this->userlog->formatTime($logs[$log_id]['log_time']);
$logs[$log_id]['last_login'] = $this->userlog->formatTime($logs[$log_id]['last_login']);
- 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 _getRemoteData
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getRemoteData($url)
{
ini_set('user_agent', $this->_getUserAgent());
switch ($this->_getUpdateMethod()) {
Function insertUpdate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function insertUpdate($object, $duplicate = [], $force = true)
{
$handler = $this->loadHandler('write');
if (!$object->isDirty()) {
- 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 loginregHistoryShow
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function loginregHistoryShow($args)
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('uid', 0), 'AND');
$criteria->add(new Criteria('post', '%pass%', 'LIKE'), 'AND'); // login or register
- 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 checkVerXoops
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerXoops(XoopsModule $module = null, $requiredVer = null)
{
$moduleDirName = basename(dirname(__DIR__));
if (null === $module) {
$module = XoopsModule::getByDirname($moduleDirName);
- 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 userlog_views_edit
has 72 lines of code (exceeds 25 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
UserlogLog
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class UserlogLog extends XoopsObject
{
/**
* @var string
*/
Function _getRemoteIniFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function _getRemoteIniFile($url, $path)
{
// local and remote file are the same, no update possible
if ($url == $path) {
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
Method loginregHistoryShow
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loginregHistoryShow($args)
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('uid', 0), 'AND');
$criteria->add(new Criteria('post', '%pass%', 'LIKE'), 'AND'); // login or register
Method getLogsCounts
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLogsCounts($criteria = null, $fields = null, $asObject = true, $id_as_key = true)
{
if (is_array($fields) && count($fields) > 0) {
if (!in_array($this->keyName, $fields)) {
$fields[] = $this->keyName;
Function validate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate(elName, elType, prevent, disablecat, elMsg) {
var i = 0;
var el = document.getElementsByName(elName);
var is_valid = true;
switch (elType) {
Function createCacheOldWay
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
{
$browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
if ($actLikeNewVersion) {
- 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 _pregUnQuote
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _pregUnQuote($pattern, $matches)
{
// list of escaped characters: http://www.php.net/manual/en/function.preg-quote.php
// to properly unescape '?' which was changed to '.', I replace '\.' (real dot) with '\?',
// then change '.' to '?' and then '\?' to '.'.
Method createCacheOldWay
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
{
$browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
if ($actLikeNewVersion) {
Function getPlugins
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function getPlugins($pluginName = 'system', $inactiveModules = false)
{
static $plugins = [];
if (!isset($plugins[$pluginName])) {
$plugins[$pluginName] = [];
- 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 getSet
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
Function getSet
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- 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 insertUpdate
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insertUpdate($object, $duplicate = [], $force = true)
{
$handler = $this->loadHandler('write');
if (!$object->isDirty()) {
Method _getRemoteIniFile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getRemoteIniFile($url, $path)
{
// local and remote file are the same, no update possible
if ($url == $path) {
return false;
Method updateCache
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateCache()
{
$lockfile = $this->cacheDir . 'cache.lock';
$lockRes = fopen($lockfile, 'w+');