upload accesses the super-global variable $_FILES. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
upload accesses the super-global variable $_POST. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
upload accesses the super-global variable $_FILES. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
upload accesses the super-global variable $_FILES. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
Function upload
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 upload
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
Function clear_tmp_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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 get_badips
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 using undefined variables such as '$a_poster' which will lead to PHP notices. Open
$rank['title'] ? $a_poster['rank'] = $rank['title'] : $a_poster['rank'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$rank['image'] ? $a_poster['rank_img'] = "<img src='" . XOOPS_URL . '/uploads/' . $rank['image'] . '\' alt=\'\'>' : $a_poster['rank_img'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$xoopsUser ? $a_poster['poster'] = "<a href='../../userinfo.php?uid=$user_id'>" . $poster->uname() . '</a>' : $a_poster['poster'] = $poster->uname();
- 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 '$a_poster' which will lead to PHP notices. Open
$poster->user_avatar() ? $a_poster['avatar'] = "<img src='" . XOOPS_URL . '/uploads/' . $poster->user_avatar() . '\' alt=\'\'>' : $a_poster['avatar'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$rank['title'] ? $a_poster['rank'] = $rank['title'] : $a_poster['rank'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$a_poster['rank_img'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$xoopsUser ? $a_poster['poster'] = "<a href='../../userinfo.php?uid=$user_id'>" . $poster->uname() . '</a>' : $a_poster['poster'] = $poster->uname();
- 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 '$a_poster' which will lead to PHP notices. Open
$a_poster['avatar'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$rank['image'] ? $a_poster['rank_img'] = "<img src='" . XOOPS_URL . '/uploads/' . $rank['image'] . '\' alt=\'\'>' : $a_poster['rank_img'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$poster->user_avatar() ? $a_poster['avatar'] = "<img src='" . XOOPS_URL . '/uploads/' . $poster->user_avatar() . '\' alt=\'\'>' : $a_poster['avatar'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
$a_poster['rank'] = '';
- 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 '$a_poster' which will lead to PHP notices. Open
return $a_poster;
- 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
Missing class import via use statement (line '33', column '48'). Open
$uploader = new \XoopsMediaUploader($photos_dir, $array_allowed_mimetypes, $helper->getConfig('photo_maxsize'), $helper->getConfig('photo_maxwidth'), $helper->getConfig('photo_maxheight'));
- 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 '113', column '23'). Open
$poster = new \XoopsUser($user_id);
- 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 142. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 0;
}
- 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
Remove error control operator '@' on line 36. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
Remove error control operator '@' on line 150. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 0;
}
- 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
The method upload uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$msgstop .= $uploader->getErrors();
}
- 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 get_user_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$a_poster['rank'] = '';
$a_poster['avatar'] = '';
$a_poster['rank_img'] = '';
}
- 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 'XoopsModules\Xfguestbook\Helper' in method 'upload'. Open
$helper = Helper::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 upload uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$photos_dir = XOOPS_UPLOAD_PATH . '/' . $xoopsModule->getVar('dirname');
$array_allowed_mimetypes = ['image/gif', 'image/pjpeg', 'image/jpeg', 'image/x-png'];
$uploader = new \XoopsMediaUploader($photos_dir, $array_allowed_mimetypes, $helper->getConfig('photo_maxsize'), $helper->getConfig('photo_maxwidth'), $helper->getConfig('photo_maxheight'));
if ($uploader->fetchMedia($field) && $uploader->upload()) {
- 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 '142', column '15'). Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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
The method get_badips uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
while (list($ip_id, $ip_value) = $xoopsDB->fetchRow($result)) {
$ret[] = $ip_value;
}
}
- 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 'XoopsModules\Xfguestbook\Helper' in method 'get_user_data'. Open
$helper = Helper::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 'XoopsModules\Xfguestbook\Helper' in method 'getAllCountry'. Open
$helper = Helper::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 unused local variables such as '$ip_id'. Open
while (list($ip_id, $ip_value) = $xoopsDB->fetchRow($result)) {
- 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 '$prefix_len'. Open
$prefix_len = mb_strlen($prefix);
- 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 '$action'. Open
global $xoopsDB, $action;
- 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 '$action'. Open
global $xoopsDB, $action;
- 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 static function getCountry($criteria = null, $limit = 0, $start = 0)
{
global $xoopsDB, $action;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_country');
- 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 120.
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
Avoid excessively long variable names like $array_allowed_mimetypes. Keep variable name length under 20. Open
$array_allowed_mimetypes = ['image/gif', 'image/pjpeg', 'image/jpeg', 'image/x-png'];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The parameter $dir_path is not named in camelCase. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 0;
}
- 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 $user_id is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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
Method name "Utility::email_exist" is not in camel caps format Open
public static function email_exist($email)
- Exclude checks
Method name "Utility::clear_tmp_files" is not in camel caps format Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
- Exclude checks
Method name "Utility::get_badips" is not in camel caps format Open
public static function get_badips($all = null)
- Exclude checks
Method name "Utility::get_user_data" is not in camel caps format Open
public static function get_user_data($user_id)
- Exclude checks
The 'get_user_data()' method which returns a boolean should be named 'is...()' or 'has...()' Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- Read upRead up
- Exclude checks
BooleanGetMethodName
Since: 0.2
Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
Example
class Foo {
/**
* @return boolean
*/
public function getFoo() {} // bad
/**
* @return bool
*/
public function isFoo(); // ok
/**
* @return boolean
*/
public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}
Source https://phpmd.org/rules/naming.html#booleangetmethodname
Line exceeds 120 characters; contains 220 characters Open
$uploader = new \XoopsMediaUploader($photos_dir, $array_allowed_mimetypes, $helper->getConfig('photo_maxsize'), $helper->getConfig('photo_maxwidth'), $helper->getConfig('photo_maxheight'));
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
$xoopsUser ? $a_poster['poster'] = "<a href='../../userinfo.php?uid=$user_id'>" . $poster->uname() . '</a>' : $a_poster['poster'] = $poster->uname();
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
$rank['image'] ? $a_poster['rank_img'] = "<img src='" . XOOPS_URL . '/uploads/' . $rank['image'] . '\' alt=\'\'>' : $a_poster['rank_img'] = '';
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$poster->user_avatar() ? $a_poster['avatar'] = "<img src='" . XOOPS_URL . '/uploads/' . $poster->user_avatar() . '\' alt=\'\'>' : $a_poster['avatar'] = '';
- Exclude checks
The variable $preview_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $preview_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $preview_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $array_allowed_mimetypes is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $photos_dir is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $prefix_len is not named in camelCase. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $photos_dir is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $user_id is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $dir_path is not named in camelCase. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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_value is not named in camelCase. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 $tmp_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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_value is not named in camelCase. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 $user_id is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $photos_dir is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $user_id is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $dir_path is not named in camelCase. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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_id is not named in camelCase. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 $array_allowed_mimetypes is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $preview_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $preview_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $tmp_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $tmp_name is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $photos_dir is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $photos_dir is not named in camelCase. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 $a_poster is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 get_user_data is not named in camelCase. Open
public static function get_user_data($user_id)
{
global $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 get_badips is not named in camelCase. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 email_exist is not named in camelCase. Open
public static function email_exist($email)
{
if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) {
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 clear_tmp_files is not named in camelCase. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 0;
}
- 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() {
}
}