Showing 113 of 1,244 total issues
Function getOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 storeDb
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function storeDb($tolog, $force = true)
{
// set vars
foreach ($tolog as $option => $logvalue) {
if (!empty($logvalue)) {
- 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 storeFile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
Method loginregHistoryForm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loginregHistoryForm($args, $eleNamePrefix = 'options')
{
// require_once XOOPS_ROOT_PATH . "/class/blockform.php"; //reserve for 2.6
xoops_load('XoopsFormLoader');
// $form = new XoopsBlockForm(); //reserve for 2.6
Method checkVerXoops
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerXoops(XoopsModule $module = null, $requiredVer = null)
{
$moduleDirName = basename(dirname(__DIR__));
if (null === $module) {
$module = XoopsModule::getByDirname($moduleDirName);
Method mergeFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeFiles($log_files = [], $mergeFileName = null)
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
Method getAll
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAll(
$type = [],
$start = 0,
$limit = 0,
$sort = 'stats_value',
Method logForm
has 32 lines of code (exceeds 25 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']);
Function getAll
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getAll(
$type = [],
$start = 0,
$limit = 0,
$sort = 'stats_value',
- 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 _array2string
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _array2string($array)
{
$content = "array(\n";
foreach ($array as $key => $value) {
- 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 storeFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- 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 arrayToDisplay
has 31 lines of code (exceeds 25 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']);
Method stats_typeForm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stats_typeForm($args, $eleNamePrefix = 'options')
{
// require_once XOOPS_ROOT_PATH . "/class/blockform.php"; //reserve for 2.6
xoops_load('XoopsFormLoader');
// $form = new XoopsBlockForm(); //reserve for 2.6
Method zipFiles
has 29 lines of code (exceeds 25 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');
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
$this->userlog = Userlog::getInstance();
$this->initVar('log_id', XOBJ_DTYPE_INT, null, false);
$this->initVar('log_time', XOBJ_DTYPE_INT, null, true);
Method item
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function item($subscribe_from)
{
if (empty($subscribe_from)) {
$script_arr = [];
$script_arr['topic_id'] = ['viewtopic.php'];
Function setItem
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setItem()
{
// In very rare occasions like newbb the item_id is not in the URL $_REQUEST
require_once __DIR__ . '/plugin/plugin.php';
require_once __DIR__ . '/plugin/Abstract.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 patchLoginHistory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function patchLoginHistory($post = null, $uid = 0, $unsetPass = true)
{
if ($uid > 0 || empty($post['pass']) || empty($post['uname'])) {
return $post;
}
- 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 copyFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
Method renameFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);