getOptions accesses the super-global variable $_FILES. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $GLOBALS. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_POST. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_COOKIE. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_REQUEST. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_GET. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SESSION. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $GLOBALS. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_ENV. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $GLOBALS. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $GLOBALS. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $_SERVER. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getOptions accesses the super-global variable $GLOBALS. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method getOptions
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
File setting.php
has 449 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.
The class UserlogSetting has an overall complexity of 61 which is very high. The configured complexity threshold is 50. Open
class UserlogSetting extends XoopsObject
{
/**
* @var string
*/
- Exclude checks
Method getSet
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
Function getSet
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method logForm
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function logForm($options = null)
{
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
$headers = $this->getOptions('', 'title');
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
Method getSets
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'set_id',
$order = 'DESC',
Function logForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function logForm($options = null)
{
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
$headers = $this->getOptions('', 'title');
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $sets;
Avoid too many return
statements within this method. Open
return $sets;
The method getOptions() has an NPath complexity of 2688. The configured NPath complexity threshold is 200. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 getOptions() has 237 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- Exclude checks
The method getSet() has an NPath complexity of 6912. The configured NPath complexity threshold is 200. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 getOptions() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 getSet() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 '$gid_unique_gid' which will lead to PHP notices. Open
$gid_unique_gid[$key] = 'gid' . $gid;
- 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 '$gid_unique_gid' which will lead to PHP notices. Open
in_array($sLogbyId, $gid_unique_gid)
- 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
The method setDb has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation. Open
public function setDb($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
The method storeSet has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation. Open
public function storeSet($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
The method getSets 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
Missing class import via use statement (line '551', column '53'). Open
$el[$ele . $type] = new XoopsFormText(constant($defEl), "options[{$ele}{$type}]", 10, 255, !empty($options[$ele . $type]) ? $options[$ele . $type] : null);
- 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 getSets 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
Missing class import via use statement (line '530', column '24'). Open
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
- 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 '540', column '37'). Open
$el[$ele] = new XoopsFormRadio(constant($defEl), "options[{$ele}]", isset($options[$ele]) ? $options[$ele] : '');
- 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 '619', 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
Avoid using static access to class 'XoopsCache' in method '_loadCacheFile'. Open
return XoopsCache::read($key);
- 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 '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 assigning values to variables in if clauses and the like (line '124', column '17'). Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 '134', column '13'). Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 'XoopsCache' in method '_deleteCacheFile'. Open
return XoopsCache::delete($key);
- 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 '117', column '13'). Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 'XoopsUserUtility' in method 'getSet'. Open
$unique_ip = XoopsUserUtility::getIP(); // ip as int
- 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 'XoopsCache' in method '_createCacheFile'. Open
return XoopsCache::write($key, $data);
- 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 '130', column '13'). Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 getOptions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$uid = 0;
$uname = '';
$last_login = 0;
$admin = 0;
- 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 parameters such as '$root_path'. Open
private function _createCacheFile($data, $name = null, $root_path = XOOPS_CACHE_PATH)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$force'. Open
public function storeSet($force = true)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$root_path'. Open
private function _loadCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$root_path'. Open
private function _deleteCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused local variables such as '$def'. Open
foreach ($headers as $ele => $def) {
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class UserlogSetting extends XoopsObject
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class UserlogSettingHandler extends XoopsPersistableObjectHandler
- Exclude checks
The parameter $unique_id is not named in camelCase. Open
public function setFile($logby = 'uid', $unique_id, $options)
{
return $this->_createCacheFile($options, "setting_{$logby}_{$unique_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 $unique_id is not named in camelCase. Open
public function getFile($logby = 'uid', $unique_id)
{
return $this->_loadCacheFile("setting_{$logby}_{$unique_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 $unique_id is not named in camelCase. Open
public function deleteFile($logby = 'uid', $unique_id)
{
return $this->_deleteCacheFile("setting_{$logby}_{$unique_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 $root_path is not named in camelCase. Open
private function _deleteCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
{
if (empty($name)) {
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 property $all_logby is not named in camelCase. Open
class UserlogSetting extends XoopsObject
{
/**
* @var string
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The parameter $root_path is not named in camelCase. Open
private function _createCacheFile($data, $name = null, $root_path = XOOPS_CACHE_PATH)
{
$name = $name ?: (string)time();
$key = USERLOG_DIRNAME . "_{$name}";
- 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 $root_path is not named in camelCase. Open
private function _loadCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
{
if (empty($name)) {
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
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 22. Open
<?php
- Exclude checks
The parameter $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $el. Configured minimum length is 3. Open
$el = [];
- 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
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 getSets(
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'set_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
Avoid variables with short names like $V. Configured minimum length is 3. Open
public function getOptions($option = null, $V = 'value')
- 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
Each class must be in a file by itself Open
class UserlogSettingHandler extends XoopsPersistableObjectHandler
- Exclude checks
Method name "UserlogSetting::unique_id" is not in camel caps format Open
public function unique_id()
- Exclude checks
Method name "_deleteCacheFile" should not be prefixed with an underscore to indicate visibility Open
private function _deleteCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
- Exclude checks
Method name "_createCacheFile" should not be prefixed with an underscore to indicate visibility Open
private function _createCacheFile($data, $name = null, $root_path = XOOPS_CACHE_PATH)
- Exclude checks
Method name "_loadCacheFile" should not be prefixed with an underscore to indicate visibility Open
private function _loadCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$defEl = '_AM_USERLOG_' . strtoupper($ele . $type); // if constant is defined in translation - it is good for now
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$el[$ele . $type]->setDescription(sprintf(constant($defEl . '_FORM'), constant($defEle), constant($defEle)));
- Exclude checks
Arguments with default values must be at the end of the argument list Open
public function setFile($logby = 'uid', $unique_id, $options)
- Exclude checks
Arguments with default values must be at the end of the argument list Open
public function deleteFile($logby = 'uid', $unique_id)
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$el[$ele] = new XoopsFormRadio(constant($defEl), "options[{$ele}]", isset($options[$ele]) ? $options[$ele] : '');
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$defEl = '_AM_USERLOG_' . strtoupper($ele); // if constant is defined in translation - it is good for now
- Exclude checks
Arguments with default values must be at the end of the argument list Open
public function getFile($logby = 'uid', $unique_id)
- Exclude checks
Line exceeds 120 characters; contains 183 characters Open
$el[$ele . $type] = new XoopsFormText(constant($defEl), "options[{$ele}{$type}]", 10, 255, !empty($options[$ele . $type]) ? $options[$ele . $type] : null);
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$ret['post']['value'] = $this->userlog->patchLoginHistory($ret['post']['value'], $uid, !empty($ret['unset_pass']['value']));
- Exclude checks
The variable $unique_uid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $ip_unique_ip is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $sUnique_id is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_gid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $uid_unique_uid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_gid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_id is not named in camelCase. Open
public function getFile($logby = 'uid', $unique_id)
{
return $this->_loadCacheFile("setting_{$logby}_{$unique_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 $unique_ip is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $sUnique_id is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $gid_unique_gid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_uid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_uid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $ip_unique_ip is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $gid_unique_gid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $uid_unique_uid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $sUnique_id is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_id is not named in camelCase. Open
public function setFile($logby = 'uid', $unique_id, $options)
{
return $this->_createCacheFile($options, "setting_{$logby}_{$unique_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 $unique_id is not named in camelCase. Open
public function deleteFile($logby = 'uid', $unique_id)
{
return $this->_deleteCacheFile("setting_{$logby}_{$unique_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 $unique_gid is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_ip is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $unique_ip is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $sUnique_id is not named in camelCase. Open
public function getSet()
{
$options = '';
// if uid setting exist in File
$unique_uid = $this->userlog->getUser() ? $this->userlog->getUser()->getVar('uid') : 0;
- Read upRead up
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $last_login is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 getSets(
$limit = 0,
$start = 0,
$otherCriteria = null,
$sort = 'set_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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $query_types is not named in camelCase. Open
public function logForm($options = null)
{
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
$headers = $this->getOptions('', 'title');
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
- Read upRead up
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $last_login is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $last_login is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $V is not named in camelCase. Open
public function getOptions($option = null, $V = 'value')
{
$V = strtolower($V);
if ($this->userlog->getUser()) {
- 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 $query_types is not named in camelCase. Open
public function logForm($options = null)
{
$form = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
$headers = $this->getOptions('', 'title');
unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
- Read upRead up
- 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 unique_id is not named in camelCase. Open
public function unique_id()
{
if ('ip' === $this->getVar('logby')) {
return long2ip($this->getVar('unique_id'));
}
- 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() {
}
}
Source
The method _deleteCacheFile is not named in camelCase. Open
private function _deleteCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
{
if (empty($name)) {
return false;
}
- 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() {
}
}
Source
The method _createCacheFile is not named in camelCase. Open
private function _createCacheFile($data, $name = null, $root_path = XOOPS_CACHE_PATH)
{
$name = $name ?: (string)time();
$key = USERLOG_DIRNAME . "_{$name}";
- 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() {
}
}
Source
The method _loadCacheFile is not named in camelCase. Open
private function _loadCacheFile($name = null, $root_path = XOOPS_CACHE_PATH)
{
if (empty($name)) {
return false;
}
- 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() {
}
}