sendFriend accesses the super-global variable $GLOBALS. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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
sendFriend accesses the super-global variable $GLOBALS. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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
sendFriend accesses the super-global variable $GLOBALS. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
sendFriend accesses the super-global variable $GLOBALS. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
mailAd accesses the super-global variable $GLOBALS. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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
Method mailAd
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$helper = Helper::getInstance();
Method sendFriend
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
Method mailAd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
Missing class import via use statement (line '82', column '28'). Open
$jlm_captcha = new \XoopsFormCaptcha(_ADSLIGHT_CAPTCHA, 'xoopscaptcha', false);
- 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 '\XoopsModules\Adslight\Helper' in method 'mailAd'. 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 'XoopsCaptcha' in method 'mailAd'. Open
$xoopsCaptcha = XoopsCaptcha::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\Adslight\Helper' in method 'sendFriend'. 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\Adslight\Utility' in method 'mailAd'. Open
$tags['TYPE'] = Utility::getNameType($type);
- 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\Adslight\Helper' in method 'mailAd'. 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 '$date_created'. Open
[$lid, $title, $expire, $type, $desctext, $tel, $price, $typeprice, $date_created, $email, $submitter, $town, $country, $photo] = $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 '$iddee'. Open
$idd = $idde = $iddee = '';
- 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 '$photo'. Open
[$lid, $title, $expire, $type, $desctext, $tel, $price, $typeprice, $date_created, $email, $submitter, $town, $country, $photo] = $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 '$xoopsLogger'. Open
global $xoopsDB, $xoopsTheme, $xoopsLogger;
- 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 '$xoopsTheme'. Open
global $xoopsDB, $xoopsTheme, $xoopsLogger;
- 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 '$xoopsTpl'. Open
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
- 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 '$email'. Open
[$lid, $title, $expire, $type, $desctext, $tel, $price, $typeprice, $date_created, $email, $submitter, $town, $country, $photo] = $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
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 35 and the first side effect is on line 31. Open
<?php declare(strict_types=1);
- Exclude checks
There must be one USE keyword per declaration Open
use XoopsModules\Adslight\{
- Exclude checks
Line exceeds 120 characters; contains 221 characters Open
$sql = 'SELECT lid, title, expire, type, desctext, tel, price, typeprice, date_created, email, submitter, town, country, photo FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE lid=' . $xoopsDB->escape($lid);
- Exclude checks
Line exceeds 120 characters; contains 162 characters Open
[$lid, $title, $expire, $type, $desctext, $tel, $price, $typeprice, $date_created, $email, $submitter, $town, $country, $photo] = $xoopsDB->fetchRow($result);
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/mail_template/');
- Exclude checks
The variable $jlm_captcha is not named in camelCase. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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 $date_created is not named in camelCase. Open
function mailAd($lid, $yname, $ymail, $fname, $fmail): void
{
global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
$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 $jlm_captcha is not named in camelCase. Open
function sendFriend($lid): void
{
global $xoopsDB, $xoopsTheme, $xoopsLogger;
$helper = Helper::getInstance();
$idd = $idde = $iddee = '';
- 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();
}
}