File log.php
has 961 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
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 getLogsFromFiles
has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = 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 getViews
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- 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 getLogsCounts
has a Cognitive Complexity of 32 (exceeds 5 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;
- 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 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
Method getViews
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
The class UserlogLog has 19 public methods. Consider refactoring UserlogLog to keep number of public methods under 10. Open
class UserlogLog extends XoopsObject
{
/**
* @var string
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class UserlogLog has an overall complexity of 179 which is very high. The configured complexity threshold is 50. Open
class UserlogLog extends XoopsObject
{
/**
* @var string
*/
- Exclude checks
The class UserlogLogHandler has 11 public methods. Consider refactoring UserlogLogHandler to keep number of public methods under 10. Open
class UserlogLogHandler extends XoopsPersistableObjectHandler
{
public $userlog = null;
/**
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class UserlogLogHandler has an overall complexity of 63 which is very high. The configured complexity threshold is 50. Open
class UserlogLogHandler extends XoopsPersistableObjectHandler
{
public $userlog = null;
/**
- Exclude checks
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
UserlogLog
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class UserlogLog extends XoopsObject
{
/**
* @var string
*/
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 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 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);
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 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);
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
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);
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 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 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 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $newFile;
Avoid too many return
statements within this method. Open
return $newFile;
Avoid too many return
statements within this method. Open
return $mergeFile;
Avoid too many return
statements within this method. Open
return true;
Function buildFileSelectEle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
{
// $modversion['config'][$i]['options'] = array(_AM_USERLOG_FILE_WORKING=>'0',_AM_USERLOG_STATS_FILEALL=>'all');
if (0 == count($currentFile) || '0' == $currentFile[0]) {
$currentFile = $this->userlog->getWorkingFile();
- 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 exportLogsToCsv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function exportLogsToCsv($logs, $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$csvFile = $this->userlog->getConfig('logfilepath') . '/' . USERLOG_DIRNAME . '/export/csv/' . $csvNamePrefix . '_' . date('Y-m-d_H-i-s') . '.csv';
// file create/open/write
/** @var \XoopsFileHandler $fileHandler */
- 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 mergeFiles
has a Cognitive Complexity of 6 (exceeds 5 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);
- 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
The method getViews() has 119 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Exclude checks
The method getViews() has an NPath complexity of 304128. The configured NPath complexity threshold is 200. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The class UserlogLog has 1014 lines of code. Current threshold is 1000. Avoid really long classes. Open
class UserlogLog extends XoopsObject
{
/**
* @var string
*/
- Exclude checks
The method arrayToDisplay() has an NPath complexity of 201. The configured NPath complexity threshold is 200. 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
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getLogsFromFiles() has 138 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Exclude checks
The method getLogsFromFiles() has an NPath complexity of 388224. The configured NPath complexity threshold is 200. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getLogsCounts() has an NPath complexity of 320. The configured NPath complexity threshold is 200. 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;
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getViews() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method storeDb() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public function storeDb($tolog, $force = true)
{
// set vars
foreach ($tolog as $option => $logvalue) {
if (!empty($logvalue)) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getLogsFromFiles() has a Cyclomatic Complexity of 39. The configured cyclomatic complexity threshold is 10. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method arrayToDisplay() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. 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
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getLogsCounts() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. 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;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid using undefined variables such as '$col2' which will lead to PHP notices. Open
$col2[$link] = $item['count'];//second sort by
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$col1' which will lead to PHP notices. Open
$col1[$link] = $item[$sort];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$col' which will lead to PHP notices. Open
$col[$key] = $log[$sort];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$csvFile' which will lead to PHP notices. Open
return $csvFile;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$csvFile' which will lead to PHP notices. Open
if ($csvFile == $this->exportLogsToCsv($logs, $headers, $csvNamePrefix . 'from_file_total_' . $totalLogs, $delimiter)) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$sql' which will lead to PHP notices. Open
xoops_error($this->db->error() . '<br>' . $sql);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Remove error control operator '@' on line 857. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '194', column '33'). Open
$criteriaUser = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method store has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation. Open
public function store($tolog, $force = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '175', column '39'). Open
$criteriaScript = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '190', column '37'). Open
$criteriaSince->add(new Criteria('log_time', $starttime, '>'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '167', column '41'). Open
$criteriaItemName = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '200', column '41'). Open
$criteriaGroup->add(new Criteria('groups', '%g' . $group . '%', 'LIKE'), 'OR');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '195', column '36'). Open
$criteriaUser->add(new Criteria('uid', '(' . implode(',', $users) . ')', 'IN'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '165', column '37'). Open
$criteriaItem = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '171', column '52'). Open
$criteriaItemName->add(new Criteria('item_name', $item_name), 'OR');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '198', column '34'). Open
$criteriaGroup = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method storeDb has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation. Open
public function storeDb($tolog, $force = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '178', column '50'). Open
$criteriaScript->add(new Criteria('script', $script_name), 'OR');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 813. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '163', column '35'). Open
$criteriaModule = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '166', column '40'). Open
$criteriaItem->add(new Criteria('module', $module_dir));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '205', column '25'). Open
$criteria = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '189', column '34'). Open
$criteriaSince = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '943', column '20'). Open
$zip = new ZipArchive();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method getLogsCounts has a boolean flag argument $asObject, which is a certain sign of a Single Responsibility Principle violation. Open
public function getLogsCounts($criteria = null, $fields = null, $asObject = true, $id_as_key = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '1177', column '25'). Open
$criteria = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method getLogs has a boolean flag argument $asObject, which is a certain sign of a Single Responsibility Principle violation. Open
$asObject = true,
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getLogs has a boolean flag argument $id_as_key, which is a certain sign of a Single Responsibility Principle violation. Open
$id_as_key = true
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getLogsCounts has a boolean flag argument $id_as_key, which is a certain sign of a Single Responsibility Principle violation. Open
public function getLogsCounts($criteria = null, $fields = null, $asObject = true, $id_as_key = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '978', column '23'). Open
$fileEl = new XoopsFormSelect(_AM_USERLOG_FILE, 'file', $currentFile, $size, $multi);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '1084', column '25'). Open
$criteria = new CriteriaCompo();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method buildFileSelectEle has a boolean flag argument $multi, which is a certain sign of a Single Responsibility Principle violation. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using static access to class 'Userlog' in method '__construct'. Open
$this->userlog = Userlog::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'XoopsFile' in method 'readFile'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getViews uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$link = $loglogObj->script();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '444', column '19'). Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getLogsFromFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$flagStr = false;
if (false !== strpos($log[$op], $qry)) {
$flagStr = true; // have that dont delete
break; // means OR
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method mergeFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$mergeFile .= $mergeFileName;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '754', column '19'). 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
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'renameFile'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLogsFromFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// if there is one value - deal with =, > ,<
if (1 == count($val_arr)) {
$val_int = $val_arr[0];
if ('log_time' === $op || 'last_login' === $op) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'UserlogStats' in method 'storeDb'. Open
$statsObj = UserlogStats::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'UserlogStats' in method 'storeDb'. Open
$statsObj = UserlogStats::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLogsFromFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// query is an array of int separate with comma. use OR ???
foreach ($logs as $id => $log) {
if (!in_array($log[$op], $val_arr)) {
unset($logs[$id]);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'XoopsFile' in method 'storeFile'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'UserlogStats' in method 'storeFile'. Open
$statsObj = UserlogStats::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '390', column '18'). Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '735', column '24'). Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'deleteFiles'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '674', column '19'). 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);
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'mergeFiles'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '768', column '28'). 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
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'exportLogsToCsv'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method storeFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$data = "\n";
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '654', column '19'). Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1004', column '13'). 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
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$object = $this->create(false);
while (false !== ($myrow = $this->db->fetchArray($result))) {
if ($id_as_key) {
$retCount[$myrow[$this->keyName]] = array_pop($myrow);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Xmf\Request' in method 'setItem'. Open
&& $item_id = Request::getInt($category['item_name'], 0)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '1199', column '14'). Open
public function changeField($field = null, $structure = null)
{
$sql = "ALTER TABLE {$this->table} CHANGE {$field} {$field} {$structure}";
if (!$result = $this->db->queryF($sql)) {
xoops_error($this->db->error() . '<br>' . $sql);
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '927', column '19'). 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
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'Userlog' in method '__construct'. Open
$this->userlog = Userlog::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$select = '*';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '1123', column '17'). 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;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$retCount[] = array_pop($myrow);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ret[] = $object->getValues(array_keys($myrow));
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '1258', column '14'). Open
public function addField($field = null, $structure = null)
{
if (empty($field) || empty($structure)) {
return false;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1120', column '17'). 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;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1225', column '14'). Open
public function showFields($field = null)
{
$sql = "SHOW FIELDS FROM {$this->table}";
if (isset($field)) {
$sql .= " LIKE '{$field}'";
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1350', column '14'). Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1286', column '14'). Open
public function dropField($field = null)
{
if (empty($field)) {
return false;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '1311', column '14'). Open
public function showIndex($index = null)
{
$sql = "SHOW INDEX FROM {$this->table}";
if (isset($index)) {
$sql .= " WHERE KEY_NAME = '{$index}'";
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'zipFiles'. Open
$folderHandler = XoopsFile::getHandler('folder', $zipFolder, true);// create if not exist
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'XoopsFile' in method 'copyFile'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '1378', column '14'). Open
public function dropIndex($index = null)
{
if (empty($index)) {
return false;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ret[] = $object;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '1033', column '24'). 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
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'Userlog_Module_Plugin' in method 'setItem'. Open
if ($plugin = Userlog_Module_Plugin::getPlugin($this->userlog->getLogModule()->getVar('dirname'), USERLOG_DIRNAME, true)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '1452', column '14'). Open
public function renameTable($oldTable)
{
if ($this->showTable() || !$this->showTable($oldTable)) {
return false;
} // table is current || oldTable is not exist
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'XoopsFile' in method 'parseFiles'. Open
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method zipFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$zipFileName .= '.zip';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method getLogsCounts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$retCount[] = array_pop($myrow);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused local variables such as '$totalFiles'. Open
if (0 == ($totalFiles = count($log_files))) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$totalFiles'. Open
if (0 == ($totalFiles = count($log_files))) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$logs'. Open
$logs = [];
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$ret'. Open
if (false === ($ret = $fileHandler->delete())) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$log'. Open
foreach ($logs as $log_id => $log) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = rename($log_file, $old_file)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$totalFiles'. Open
if (0 == ($totalFiles = count($log_files))) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$totalFiles'. Open
if (0 == ($totalFiles = count($log_files))) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$folderHandler'. Open
$folderHandler = XoopsFile::getHandler('folder', $zipFolder, true);// create if not exist
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF($sql)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF($sql)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF($sql)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$sql'. Open
xoops_error($this->db->error() . '<br>' . $sql);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF("ALTER TABLE {$oldTable} RENAME {$this->table}")) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF($sql)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$result'. Open
if (!$result = $this->db->queryF($sql)) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 289.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 289.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 215.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
public function dropField($field = null)
{
if (empty($field)) {
return false;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
public function dropIndex($index = null)
{
if (empty($index)) {
return false;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class UserlogLogHandler extends XoopsPersistableObjectHandler
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class UserlogLog extends XoopsObject
- Exclude checks
Avoid variables with short names like $tt. Configured minimum length is 3. Open
$tt = substr($key, -2);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The parameter $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_files is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_files is not named in camelCase. Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $op. Configured minimum length is 3. Open
$op = substr($key, 0, -2);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The parameter $log_files is not named in camelCase. Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $db. Configured minimum length is 3. Open
public function __construct(XoopsDatabase $db)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The parameter $id_as_key is not named in camelCase. Open
public function getLogs(
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'log_id',
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $index_type is not named in camelCase. Open
public function changeIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if ($this->showIndex($index) && !$this->dropIndex($index)) {
return false;
} // if index is exist but cannot drop it
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $id_as_key is not named in camelCase. 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;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $index_type is not named in camelCase. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 31 and the first side effect is on line 25. Open
<?php
- Exclude checks
Each class must be in a file by itself Open
class UserlogLogHandler extends XoopsPersistableObjectHandler
- Exclude checks
Method name "UserlogLog::last_login" is not in camel caps format Open
public function last_login()
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
&& in_array($this->script(), is_array($category['subscribe_from']) ? $category['subscribe_from'] : [$category['subscribe_from']])
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$zipFileName = $this->userlog->getConfig('logfilename') . '_zip_' . $totalFiles . '_files_' . date('Y-m-d_H-i-s') . '.zip';
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if ($csvFile == $this->exportLogsToCsv($logs, $headers, $csvNamePrefix . 'from_file_total_' . $totalLogs, $delimiter)) {
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$statsObj->update('referral', 0, 1, true, parse_url($logvalue, PHP_URL_HOST)); // auto increment 1
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
$link = 'modules/' . $module_dirname . '/' . $loglogObj->script() . '?' . $loglogObj->item_name() . '=' . $item_id;
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
// merge all request_method to one column - possibility to log methods when user dont set to log request_method itself
- Exclude checks
Line exceeds 120 characters; contains 206 characters Open
* @internal param array $ret = Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$csvFile = $this->userlog->getConfig('logfilepath') . '/' . USERLOG_DIRNAME . '/export/csv/' . $csvNamePrefix . '_' . date('Y-m-d_H-i-s') . '.csv';
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
&& $loglogObj->pageadmin()) ? '/admin/' : '/') . $loglogObj->script();
- Exclude checks
Arguments with default values must be at the end of the argument list Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
$log_file_name = $this->userlog->getConfig('logfilepath') . '/' . USERLOG_DIRNAME . '/' . $this->userlog->getConfig('logfilename');
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
$fileEl->addOption($path . '/' . $file, '-----' . $file . (($file == $working_file) ? '(' . _AM_USERLOG_FILE_WORKING . ')' : ''));
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$groups = explode('g', substr($logs[$log_id]['groups'], 1)); // remove the first "g" from string
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
* @param string $table or $db->prefix("{$table}") eg: $db->prefix("bb_forums") or "bb_forums" will return same result
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
if ($plugin = Userlog_Module_Plugin::getPlugin($this->userlog->getLogModule()->getVar('dirname'), USERLOG_DIRNAME, true)) {
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$logs[$log_id]['request_method'] = empty($logs[$log_id]['request_method']) ? '' : $logs[$log_id]['request_method'] . "\n";
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$mergeFile .= $this->userlog->getConfig('logfilename') . '_merge_' . count($log_files) . '_files_' . date('Y-m-d_H-i-s');
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
* @param string $oldTable or $db->prefix("{$oldTable}") eg: $db->prefix("bb_forums") or "bb_forums" will return same result
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$logs[$id][$option] = is_array($logvalue) ? ((count($logvalue) > 0) ? var_export($logvalue, true) : '') : $logvalue;
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$logs[$log_id]['request_method'] .= '$_' . strtoupper($option) . ' ' . $logs[$log_id][$option] . "\n";
- Exclude checks
The variable $script_name is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $script_name is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dir is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dir is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_name is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_id is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_id is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_name is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $module_dirname is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $old_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file_name is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $old_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $old_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_id is not named in camelCase. Open
public function getViews(
$limit = 10,
$start = 0,
$sort = 'count',
$order = 'DESC',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $old_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file_name is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function exportFilesToCsv($log_files = [], $headers, $csvNamePrefix = 'list_', $delimiter = ';')
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function readFiles($log_files = [])
{
$log_files = $this->parseFiles($log_files);
if (0 == ($totalFiles = count($log_files))) {
return $this->readFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function renameFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_int is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function readFile($log_file = null)
{
if (!$log_file) {
$log_file = $this->userlog->getWorkingFile();
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function storeFile($tolog)
{
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $val_arr is not named in camelCase. Open
public function getLogsFromFiles(
$log_files = [],
$limit = 0,
$start = 0,
$options = null,
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $id_as_key is not named in camelCase. 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;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $id_as_key is not named in camelCase. 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;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $index_type is not named in camelCase. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $index_type is not named in camelCase. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file_name is not named in camelCase. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
{
// $modversion['config'][$i]['options'] = array(_AM_USERLOG_FILE_WORKING=>'0',_AM_USERLOG_STATS_FILEALL=>'all');
if (0 == count($currentFile) || '0' == $currentFile[0]) {
$currentFile = $this->userlog->getWorkingFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $item_id is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $id_as_key is not named in camelCase. 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;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $not_config is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $id_as_key is not named in camelCase. Open
public function getLogs(
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'log_id',
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $id_as_key is not named in camelCase. 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;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $index_type is not named in camelCase. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file is not named in camelCase. Open
public function copyFile($log_file = null, $newFileName = null)
{
if (!is_string($log_file)) {
$this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $working_file is not named in camelCase. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
{
// $modversion['config'][$i]['options'] = array(_AM_USERLOG_FILE_WORKING=>'0',_AM_USERLOG_STATS_FILEALL=>'all');
if (0 == count($currentFile) || '0' == $currentFile[0]) {
$currentFile = $this->userlog->getWorkingFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $working_file is not named in camelCase. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
{
// $modversion['config'][$i]['options'] = array(_AM_USERLOG_FILE_WORKING=>'0',_AM_USERLOG_STATS_FILEALL=>'all');
if (0 == count($currentFile) || '0' == $currentFile[0]) {
$currentFile = $this->userlog->getWorkingFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $not_config is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $index_type is not named in camelCase. Open
public function changeIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if ($this->showIndex($index) && !$this->dropIndex($index)) {
return false;
} // if index is exist but cannot drop it
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $index_type is not named in camelCase. Open
public function addIndex($index = null, $fields = [], $index_type = 'INDEX')
{
if (empty($index) || empty($fields)) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $not_config is not named in camelCase. 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
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_files is not named in camelCase. Open
public function parseFiles($log_files = [])
{
$pathFiles = $this->getFilesFromFolders($log_files);
$log_files = array_unique(array_merge($log_files, $pathFiles));
// file open/read
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $log_file_name is not named in camelCase. Open
public function buildFileSelectEle($currentFile = [], $multi = false, $size = 3)
{
// $modversion['config'][$i]['options'] = array(_AM_USERLOG_FILE_WORKING=>'0',_AM_USERLOG_STATS_FILEALL=>'all');
if (0 == count($currentFile) || '0' == $currentFile[0]) {
$currentFile = $this->userlog->getWorkingFile();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method last_login is not named in camelCase. Open
public function last_login()
{
return $this->userlog->formatTime($this->getVar('last_login'));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}